If Condition for "Open URL"

** If condition.**

1-1. I am not able to find "if the URL is not "the URL it should be". Then if not the URL, then Open a URL.

1-2. If the page doesn't have ID ( ex)

....
), Then wait until it loaded.
Because sometimes, the browser loading is not stable. Sometimes slow, sometimes fast.

I use an Excute JS action with querySelector...or ID.. but checking loading is first.
I know you have "Wait For Google Chrome to Finish Loading". But we might need to have an action to check if the ID or Class is ready, then action by IF condition.
Or the color is red on X: 10, Y: 10 ( this is a way to check if the page is loaded as what I wanted. )

Do you know why I need to find these?

Thank you all

I am not sure why you are trying to do here... but you can use tokens for URL.

1-Set variable to text and use URL token
2-use IF then ELSE

1 Like

First of all, very thank you for the answer!
It works like SUPER!!! and I have learned from you that there are some tokens to handle variables. I am pretty excited to study about these!

I guess I can find some here ( manual:Variables [Keyboard Maestro Wiki], Tokens [Keyboard Maestro Wiki] )

It's like super!

BTW, why I need the if conditions are. whenever I try to make something and it's always going to wrong by unexpected issues. Therefore I add a few conditions such as the top menu bar color is ... blue and .. if there is a "logged_in" class is existed or not. :slight_smile:

It gives much safe way to have unexpected issues.

Thank you anyway!
Happy KM

You don't need to add If conditions all the times. Simply add actions by pressing + button…

1 Like

Sorry, I didn't get what you mean.
Do you mean these?
image

But what's different from adding the if action or this?

Yes simply press new action and you create a new action.

1 Like

Hey Sasi,

Carefully examine all the items in the Edit menu of the Keyboard Maestro Editor that start with “Insert”. Note all the keyboard shortcuts.

I always use the Insert Action by Name function to work with Actions, unless I'm using KMFAM or my own Insert-an-Action macro.

MACRO: [KMFAM] Favorite Actions and Macros v1.4 Released 2021-12-09

Macro: Pause Until Web Page Element Exists [Example]

-Chris

1 Like

OMG, very useful tips. Thank you so much!

1 Like