roco wrote: ↑Wed Feb 20, 2019 6:01 pm
Hi guys!
MacOS Mojave Version 10.14.3
Google Chrome Browser Version 72.0.3626.109 (Official Build) (64-bit)
iMacros
FREE Version 10.0.5 (VERSION BUILD=1005 RECORDER=CR)
On the one hand, the task can be easy-peasy but on the other hand, it's not. Especially for me
I have a simple code that works fine so far: it clicks 2 buttons.
Code: Select all
SET !REPLAYSPEED FAST
SET !ERRORIGNORE YES
SET !TIMEOUT_STEP 1
WAIT SECONDS=2
TAG POS=1 TYPE=BUTTON ATTR=TXT:Calculate
WAIT SECONDS=2
TAG POS=1 TYPE=BUTTON ATTR=TXT:Ok
Randomly there can appear the third button TYPE=BUTTON ATTR=TXT:Recalculate
What I need is to 'detect' when appears the third button, click on it and continue clicking only 2 buttons until the third appears again.
Can you advise on this? Should I use the 'EVAL' command? If yes, could you be so kind and help a newbie please
FCI very clearly mentioned, very good...!
And you even mention the 'Free'/'PE' part, I'm impressed...! (The 'PE' Version is only supported on Win OS btw...)
OK..., yeah well, I would think simply including the Tag/Click on your 'Recalculate' Button with '!ERRORIGNORE' (that you already use) would already "do the Trick", and I guess you may want to shorten '!TIMEOUT_STEP' if you don't want your Script to wait for the 6 Sec for when the 'Recalculate' Button is not there, and if your 'WAIT=2' Statements can be a little "flexible", then you can combine both "Waiting" Commands together into stg like... Oh but no!, you already have '!TIMEOUT_STEP=1', which means that your Script will then wait for 3 Sec when the 'Recalculate' Button is not there... But those 3 Sec can in return be shortened back to 2 Sec by shortening your 1st 'WAIT' Statement to only 1 Sec:
Code: Select all
SET !ERRORIGNORE YES
SET !TIMEOUT_STEP 1
WAIT SECONDS=1
TAG POS=1 TYPE=BUTTON ATTR=TXT:Calculate
WAIT SECONDS=2
TAG POS=1 TYPE=BUTTON ATTR=TXT:Ok
TYPE=BUTTON ATTR=TXT:Recalculate
The only "Problem" maybe is if you also need a 'WAIT=2' between the 'Calculate' and the 'Recalculate' Buttons. If 'WAIT=1' between those 2 Buttons is "acceptable", then for example, which will give 2.5 Sec between each Loop for when the 'Recalculate' is not there:
Code: Select all
SET !ERRORIGNORE YES
SET !TIMEOUT_STEP 1
WAIT SECONDS=0.5
TAG POS=1 TYPE=BUTTON ATTR=TXT:Calculate
WAIT SECONDS=2
TAG POS=1 TYPE=BUTTON ATTR=TXT:Ok
WAIT SECONDS=1
TYPE=BUTTON ATTR=TXT:Recalculate
And if you "really" need an "exact" 'WAIT=2' between each 'TAG'/Click on each Button, independently if the 'Recalculate' Button is there or not, then you'll indeed need to use 'EVAL()' to make one of the 'WAIT' Statements "Dynamic" (and/or combined with '!TIMEOUT_STEP' that could also be computed dynamically).
Search the Forum on "Conditional WAIT" (I think...), I've already posted an exact Solution where both the 'WAIT' and the '!TIMEOUT_STEP' were dynamically computed...
I let you search a bit, and try a bit by yourself..., and I'll give you "the" or "a" Solution later on if you don't come out by yourself, but it's not very complicated...
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...