Conditional pause with extraction how ?

Discussions and Tech Support related to the iMacros Firefox Add-on, including the built-in Javascript scripting interface for playing .js files.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
provoquestosito
Posts: 75
Joined: Sat Jan 30, 2010 12:43 am

Conditional pause with extraction how ?

Post by provoquestosito » Sat Sep 21, 2019 8:50 pm

Firefox 56 imacros 8.9.7 windows 7

With pure iim macro it's possible create a macro that extract and when extract a particular value set in pause the macro otherwise continue ?

If i made a login and sometimes there is captcha i try to extract box of captcha, when the macro find box of captcha pause the macro, otherwise continue.

Wath type of code i can use to do this ?

Thanks
chivracq
Posts: 8763
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Conditional pause with extraction how ?

Post by chivracq » Sat Sep 21, 2019 9:20 pm

provoquestosito wrote:
Sat Sep 21, 2019 8:50 pm

Code: Select all

Firefox 56 imacros 8.9.7 windows 7
With pure iim macro it's possible create a macro that extract and when extract a particular value set in pause the macro otherwise continue ?

If i made a login and sometimes there is captcha i try to extract box of captcha, when the macro find box of captcha pause the macro, otherwise continue.

Wath type of code i can use to do this ?

Thanks

Yep, and fairly easy to implement, and "the" Solution has already been posted several times, if you searched the Forum a bit... :idea:
=> Toggle a "YES"/"NO" with 'EVAL()' to use for '!SINGLESTEP', or in your Case for '!EXTRACT_TEST_POPUP' applied to some "fake" extra 'EXTRACT', that will do the Job also... 8)
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
provoquestosito
Posts: 75
Joined: Sat Jan 30, 2010 12:43 am

Re: Conditional pause with extraction how ?

Post by provoquestosito » Sat Sep 21, 2019 10:11 pm

Hi @chivracq

Thanks for your suggestion i solved with this code

Code: Select all

TAG POS=1 TYPE=B ATTR=TXT:Are<SP>TEXT-TO-CHECK EXTRACT=TXT
SET !VAR1 EVAL("if (\"{{!EXTRACT}}\" == \"TEXT-TO-CHECK\") {var s = 'https://actions.google.com/sounds/v1/alarms/alarm_clock.ogg';} else {var s = \"\";} s;")
SET !VAR2 EVAL("if (\"{{!EXTRACT}}\" == \"TEXT-TO-CHECK\") {var s = 'YES';} else {var s = \"NO\";} s;")
TAB OPEN
TAB T=2
' Play Sound In New Tab
URL GOTO={{!VAR1}}
TAB T=1
' Pause
SET !SINGLESTEP {{!VAR2}}
SET !SINGLESTEP NO
You are the greatest expert of imacros I have ever known, thanks so much you can solve me all the problems of imacros ;)
chivracq
Posts: 8763
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Conditional pause with extraction how ?

Post by chivracq » Sun Sep 22, 2019 12:14 am

provoquestosito wrote:
Sat Sep 21, 2019 10:11 pm
Hi @chivracq

Thanks for your suggestion i solved with this code

Code: Select all

TAG POS=1 TYPE=B ATTR=TXT:Are<SP>TEXT-TO-CHECK EXTRACT=TXT
SET !VAR1 EVAL("if (\"{{!EXTRACT}}\" == \"TEXT-TO-CHECK\") {var s = 'https://actions.google.com/sounds/v1/alarms/alarm_clock.ogg';} else {var s = \"\";} s;")
SET !VAR2 EVAL("if (\"{{!EXTRACT}}\" == \"TEXT-TO-CHECK\") {var s = 'YES';} else {var s = \"NO\";} s;")
TAB OPEN
TAB T=2
' Play Sound In New Tab
URL GOTO={{!VAR1}}
TAB T=1
' Pause
SET !SINGLESTEP {{!VAR2}}
SET !SINGLESTEP NO
You are the greatest expert of imacros I have ever known, thanks so much you can solve me all the problems of imacros ;)

Yep, very good, exactly what I meant, and you even combine it with a Conditional Sound... Very neat... 8)

Yeah well, "greatest expert of imacros", ah-ah...! :oops: , Thanks for the Compliment, but I'm not the only Advanced User on the Forum... I was just the first to see your Thread but all (Semi-)Advanced Users would have known how to solve this one... :wink:

And, hum, interesting URL for the Sound from 'google.com' instead of playing a Local Sound, that might actually be an interesting Workaround for some other Thread... :twisted:
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
provoquestosito
Posts: 75
Joined: Sat Jan 30, 2010 12:43 am

Re: Conditional pause with extraction how ?

Post by provoquestosito » Sun Sep 22, 2019 2:03 pm

@chivracq

Thank you for explaining to me the command '!SINGLESTEP'

I didn't know it is really great to create breaks with the condition, there are always new things to learn.
chivracq
Posts: 8763
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Conditional pause with extraction how ?

Post by chivracq » Sun Sep 22, 2019 5:12 pm

provoquestosito wrote:
Sun Sep 22, 2019 2:03 pm
@chivracq

Thank you for explaining to me the command '!SINGLESTEP'

I didn't know it is really great to create breaks with the condition, there are always new things to learn.

Yeah well, it's not "complicated" to learn "new things"...! 8)
=> Simply check once the 'Command Reference' in the Wiki where all Commands are listed on one same Page, and check the ones you don't know...! :idea:

And reading from time to time a few (Pages of) Threads on the Forum is also a great way to see how other Users use iMacros and what can be done with it... :idea:
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
provoquestosito
Posts: 75
Joined: Sat Jan 30, 2010 12:43 am

Re: Conditional pause with extraction how ?

Post by provoquestosito » Sun Sep 22, 2019 5:31 pm

Thanks for the suggestion of the page with the various macros commands I will study it calmly, thank you again
chivracq
Posts: 8763
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Conditional pause with extraction how ?

Post by chivracq » Sun Sep 22, 2019 7:21 pm

provoquestosito wrote:
Sun Sep 22, 2019 5:31 pm
Thanks for the suggestion of the page with the various macros commands I will study it calmly, thank you again

Yep, you're welcome...! It "should" have been your "Bible" for the last 10 years that you've been using iMacros, ah-ah...! :shock:

You even have a Link "somewhere" (I can't locate it quickly directly...) where you can download the whole Wiki to "study it calmly" Offline... 8)
=> Exam in 2 weeks...!! :wink:
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
provoquestosito
Posts: 75
Joined: Sat Jan 30, 2010 12:43 am

Re: Conditional pause with extraction how ?

Post by provoquestosito » Mon Sep 23, 2019 3:03 pm

Thanks @chivracq you are Great !
Post Reply