How to press a btn if the btn text is ...

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
alecstheone
Posts: 1
Joined: Sun Jan 25, 2015 12:38 pm

How to press a btn if the btn text is ...

Post by alecstheone » Sun Jan 25, 2015 1:46 pm

Hello, I'm creating my first imacro for including some sheduled tweets on tweetdeck.com. I import each tweet, the hour, minute, AM/PM and the day from a csv file (each of them separated thwough comma). It works well but I don't know how to check if {{!COL4}} has not the name from the AM/PM button press it once so it changes to the other meridian (AM or PM). If pressed the button chenges from PM to AM and from AM to PM
I tried with eval but I may misstipe the sintax and I would like to keep it in imaro style for not untill I gain more experience and switch to javascrpt.

this is how a first like looks like:

Code: Select all

My first tweet,11,32,AM,26
this is my code:

Code: Select all

SET !DATASOURCE C:\Users\Alexandru\Desktop\hartie.csv
SET !DATASOURCE_COLUMNS 7
SET !LOOP 1
SET !DATASOURCE_LINE {{!LOOP}}
SET EXTRACT NULL

TAG POS=1 TYPE=BUTTON ATTR=CLASS:js-schedule-button<SP>js-show-tip<SP>btn<SP>btn-on-blue<SP>full-width<SP>txt-left<SP>margin-b--12<SP>padding-v--9
TAG POS=1 TYPE=A ATTR=HREF:#{{!COL5}}
TAG POS=1 TYPE=INPUT:TEXT ATTR=ID:scheduled-hour CONTENT={{!COL2}}
TAG POS=1 TYPE=INPUT:TEXT ATTR=ID:scheduled-minute CONTENT={{!COL3}}
TAG POS=1 TYPE=A ATTR=ID:amPm EXTRACT=TXT

>>>>>>here comes this line where I get a sintax error
SET !VAR1 EVAL(var text=\"{{!EXTRACT}}\"; if(text=={{!COL4}}) TAG POS=1 TYPE=A ATTR=ID:amPm;text;)
>>>>>>

TAG POS=1 TYPE=TEXTAREA ATTR=CLASS:js-compose-text<SP>compose-text<SP>scroll-v<SP>scroll-styled-v<SP>scroll-styled-h<SP>scroll-alt<SP>padding-al<SP> CONTENT={{!COL1}}
WAIT SECONDS=3
Thank you!
skippyto
Posts: 108
Joined: Wed Aug 20, 2008 8:14 am

Re: How to press a btn if the btn text is ...

Post by skippyto » Mon Jan 26, 2015 10:41 am

Hi alecstheone,

I don't think you can't use an iMacros' command in your EVAL, only javascript.

But, as your EVAL put the value of your javascript var text in the iMacros !VAR1, it should work putting the following line under you EVAL line (and deleting the TAG command from EVAL) :

Code: Select all

TAG POS=1 TYPE=A ATTR=ID:{{!VAR1}}
Skippyto.
Post Reply