Problems With SET & Variable

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
Son_Of_Diablo
Posts: 9
Joined: Mon Dec 30, 2013 10:32 pm

Problems With SET & Variable

Post by Son_Of_Diablo » Mon Dec 30, 2013 10:41 pm

Hello

I'm new to iMacro, So sorry if this is a dump question :)


So I'm basically trying to make a scrip that grabs links (URLs) and stores them in 2 variables and uses those in another tab..
Then it will go back and grab two new links, but store them in the same variables..

But as I have it now the result after grabbing the link again will be this:

Code: Select all

http://www.link1.com[EXTRACT]http://www.link2.com
What am I doing wrong?


My code:

Code: Select all

VERSION BUILD=8601111 RECORDER=FX
TAB T=1
TAG POS=22 TYPE=A ATTR=HREF:* EXTRACT=HREF
SET !VAR1 {{!EXTRACT}}
PROMPT {{!VAR1}}
TAB OPEN
TAB T=3
URL GOTO={{!VAR1}}
WAIT SECONDS=1
SET !VAR2 {{!URLCURRENT}}
PROMPT {{!VAR2}}
TAB CLOSE
TAB T=2
TAG POS=1 TYPE=I ATTR=CLASS:icon_post_photo&&TXT:
TAG POS=1 TYPE=SPAN ATTR=TXT:URL
TAG POS=6 TYPE=INPUT:TEXT FORM=NAME:NoFormName ATTR=* CONTENT={{!VAR2}}
TAG POS=1 TYPE=DIV ATTR=DATA-TOKEN:post-plexi&&CLASS:plexi<SP>active<SP>show&&TXT:
TAG POS=1 TYPE=B ATTR=CLASS:icon&&TXT:
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:NoFormName ATTR=NAME:post[three] CONTENT={{!VAR1}}
TAG POS=1 TYPE=DIV ATTR=DATA-TOKEN:post-plexi&&CLASS:plexi<SP>active<SP>show&&TXT:
TAG POS=1 TYPE=BUTTON FORM=NAME:NoFormName ATTR=TXT:Post
WAIT SECONDS=5

TAB T=1
TAG POS=25 TYPE=A ATTR=HREF:* EXTRACT=HREF
SET !VAR1 {{!EXTRACT}}
PROMPT {{!VAR1}}
TAB OPEN
TAB T=3
URL GOTO={{!VAR1}}
WAIT SECONDS=1
SET !VAR2 {{!URLCURRENT}}
PROMPT {{!VAR2}}
TAB CLOSE
TAB T=2
TAG POS=1 TYPE=I ATTR=CLASS:icon_post_photo&&TXT:
TAG POS=1 TYPE=SPAN ATTR=TXT:URL
TAG POS=6 TYPE=INPUT:TEXT FORM=NAME:NoFormName ATTR=* CONTENT={{!VAR2}}
TAG POS=1 TYPE=DIV ATTR=DATA-TOKEN:post-plexi&&CLASS:plexi<SP>active<SP>show&&TXT:
TAG POS=1 TYPE=B ATTR=CLASS:icon&&TXT:
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:NoFormName ATTR=NAME:post[three] CONTENT={{!VAR1}}
TAG POS=1 TYPE=DIV ATTR=DATA-TOKEN:post-plexi&&CLASS:plexi<SP>active<SP>show&&TXT:
TAG POS=1 TYPE=BUTTON FORM=NAME:NoFormName ATTR=TXT:Post
WAIT SECONDS=5
Many thanks for any help you might be able to give me :)
Chillout1989
Posts: 22
Joined: Sat Oct 12, 2013 9:18 pm

Re: Problems With SET & Variable

Post by Chillout1989 » Wed Jan 01, 2014 2:21 pm

after the first 2 links, you have to set the extract to null.

SET !EXTRACT NULL

if you do this, the first two links are deleted from extract and the new extract can be used for 2 new links
Son_Of_Diablo
Posts: 9
Joined: Mon Dec 30, 2013 10:32 pm

Re: Problems With SET & Variable

Post by Son_Of_Diablo » Wed Jan 01, 2014 3:40 pm

Chillout1989 wrote:after the first 2 links, you have to set the extract to null.

SET !EXTRACT NULL

if you do this, the first two links are deleted from extract and the new extract can be used for 2 new links

Thank you that works PERFECT! :D


uhm.. If you don't mind, I have another question :)

If I used the !LOOP, could I then add a number to the variable?

like maybe:

Code: Select all

SET !LOOP {{!LOOP}}+2
would that be possible? :)
User avatar
bobis
Posts: 364
Joined: Sat Sep 11, 2010 3:34 pm
Contact:

Re: Problems With SET & Variable

Post by bobis » Thu Jan 02, 2014 6:38 am

Get Best iMacros scripts at http://imacrosbot.com/
Chillout1989
Posts: 22
Joined: Sat Oct 12, 2013 9:18 pm

Re: Problems With SET & Variable

Post by Chillout1989 » Fri Jan 03, 2014 12:53 am

like bobis said: just use the ADD command

if you want to add a number to your current loop after each loop, so the loop skips some numbers

SET !LOOP 1
SET !VAR1 {{!LOOP}}

ADD !VAR1 2
SET !LOOP {{!VAR1}}

So the number of loops should be 1,3,5,7,9 and so on...
Son_Of_Diablo
Posts: 9
Joined: Mon Dec 30, 2013 10:32 pm

Re: Problems With SET & Variable

Post by Son_Of_Diablo » Sun Jan 05, 2014 11:34 pm

Great! That works perfect! many thanks! :D
chivracq
Posts: 8716
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Problems With SET & Variable

Post by chivracq » Mon Jan 06, 2014 2:14 am

Son_Of_Diablo wrote:Great! That works perfect! many thanks! :D
Hope you took the occasion to read a little bit of the Documentation...
- (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...
Son_Of_Diablo
Posts: 9
Joined: Mon Dec 30, 2013 10:32 pm

Re: Problems With SET & Variable

Post by Son_Of_Diablo » Tue Jan 07, 2014 7:46 am

chivracq wrote:
Son_Of_Diablo wrote:Great! That works perfect! many thanks! :D
Hope you took the occasion to read a little bit of the Documentation...
I did a couple of times :)
Post Reply