As many others here, I run into simple trouble how to use the IF...Then combination. I learned that I can use javascript within EVAL. My puzzle is following.
On page, there is 'Add to your favorites' script code, which is need to be clicked IF exists. When clicked,its changed on the page into '
Added'.
Now I tried to create something like that:
SET EXTRACT NULL
TAG POS=1 TYPE=SPAN ATTR=TXT:Add<SP>to<SP>your<SP>favourites EXTRACT=TXT
SET !VAR1 EVAL(var s=\"{{!EXTRACT}}\"; if(text=="to your favourites") text = "blablabla";else text = "to your favourites";text;)
TAG POS=1 TYPE=SPAN ATTR=TXT:{{!VAR1}}
But it does not work....where I made an error? Sorry, Im newbie yet
If Then problem......again
Forum rules
iMacros EOL - Attention!
The renewal maintenance has officially ended for Progress iMacros effective November 20, 2023 and all versions of iMacros are now considered EOL (End-of-Life). The iMacros products will no longer be supported by Progress (aside from customer license issues), and these forums will also no longer be moderated from the Progress side.
Thank you again for your business and support.
Sincerely,
The Progress Team
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
iMacros EOL - Attention!
The renewal maintenance has officially ended for Progress iMacros effective November 20, 2023 and all versions of iMacros are now considered EOL (End-of-Life). The iMacros products will no longer be supported by Progress (aside from customer license issues), and these forums will also no longer be moderated from the Progress side.
Thank you again for your business and support.
Sincerely,
The Progress Team
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
Re: If Then problem......again
try this
Code: Select all
SET !VAR1 EVAL(var s=\"{{!EXTRACT}}\"; var text; if(text==\"to your favourites\") {text = \"blablabla\";}else {text = \"to your favourites\";}text;)
Get Best iMacros scripts at http://imacrosbot.com/
Re: If Then problem......again
Thanks for your help. I tried to change the line to yours, but still the problem exist.
VERSION BUILD=8510617 RECORDER=FX
TAB T=1
SET !ERRORIGNORE YES
SET EXTRACT NULL
TAG POS=1 TYPE=SPAN ATTR=TXT:Add<SP>to<SP>your<SP>favourites EXTRACT=TXT
SET !VAR1 EVAL(var s=\"{{!EXTRACT}}\"; var text; if(text==\"to your favourites\") {text = \"blablabla\";}else {text = \"to your favourites\";}text;)
TAG POS=1 TYPE=SPAN ATTR=TXT:{{!VAR1}}
'Add to your favourites' not clicked, instead error:
SyntaxError: wrong format of SET command, line: 6 (Error code: -910)
VERSION BUILD=8510617 RECORDER=FX
TAB T=1
SET !ERRORIGNORE YES
SET EXTRACT NULL
TAG POS=1 TYPE=SPAN ATTR=TXT:Add<SP>to<SP>your<SP>favourites EXTRACT=TXT
SET !VAR1 EVAL(var s=\"{{!EXTRACT}}\"; var text; if(text==\"to your favourites\") {text = \"blablabla\";}else {text = \"to your favourites\";}text;)
TAG POS=1 TYPE=SPAN ATTR=TXT:{{!VAR1}}
'Add to your favourites' not clicked, instead error:
SyntaxError: wrong format of SET command, line: 6 (Error code: -910)
Re: If Then problem......again
If I understand your problem correctly, you could just simply always (try to) click on the 'Add' Button with "SET !ERRORIGNORE YES".
If the 'Add' Button is not present, you just lose a few seconds (set by TIMEOUT_STEP)...
If the 'Add' Button is not present, you just lose a few seconds (set by TIMEOUT_STEP)...
- (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...
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
Re: If Then problem......again
here is fixed code
Code: Select all
SET !VAR1 EVAL("var s=\"{{!EXTRACT}}\"; if(s == \"to your favourites\"){text = \"blablabla\";}else {text = \"to your favourites\";}text;")
Get Best iMacros scripts at http://imacrosbot.com/