Control Logic based on URL (e.g., ChromeURL contains "gmail")

I tried adding Control Logic “If Any Condition Met Execute Actions” but it is always false regardless of what I seem to put in the contains text field (e.g., www, http, gmail, etc). Can you tell me what I can put in the contains text field to make it true given any current ChromeURL? I have tried %ChromeURL% but it appears as red. Any suggestions?

TestURLtoSeeifContainsText
No triggers specified.
Will execute the following actions:
Action iconIf Any Condition Met
Condition iconThe variable ‘ChromeURL’ contains ‘gmail’ <-- TRIED %ChromeURL% and %Variable%ChromeURL% but it appears red
Execute the Following Actions:
Action iconPrompt for User Input ‘ChromeURL is %ChromeURL% (True)’
ChromeURL is %ChromeURL% (True)
Finish with the following buttons:
OK
Cancel (cancel macro)
Store button pressed in variable ‘Result Button’.
Otherwise, Execute the Following Actions:
Action iconPrompt for User Input ‘ChromeURL is %ChromeURL% (False)’
ChromeURL is %ChromeURL% (False)
Finish with the following buttons:
OK
Cancel (cancel macro)
Store button pressed in variable ‘Result Button’.

Also, how to I attached an Exported Macro to share here?

ChromeURL is a text token, not a variable.

So you need to use a text condition not a variable condition.

If text condition %ChromeURL% contains “gmail”

1 Like

I'm trying to do the same thing (test the URL of the current Chrome Tab), but I can't find a "text condition" choice in the "If then else" Action condition.

But let me tell you my objective.

I want to do a Google Chrome search based on selected text in another app, like Outlook. So I activated Chrome, and I need to check to see if the current tab has a real URL, or only the "New Tab" with a blank URL.

So how do I test for a blank URL?

Thanks.

Do you have the current version? The Text Condition should be in there.

If you have an old version that does not have the Text condition, you can just use the Set Variable to Text and then use a Variable Condition.

To check the Chrome URL against the empty tab, do this:

1 Like