iMacros not resetting extract variable on save to file oper

Discussions and Tech Support specific to the iMacros Firefox add-on.
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
StarFaller
Posts: 13
Joined: Sat Jan 20, 2007 9:03 am

iMacros not resetting extract variable on save to file oper

Post by StarFaller » Sun May 20, 2007 8:52 am

Hi,

I've setup a small script that grabs a text, and puts it in a file.
I have decided to use multiple files to store different pieces of text.
I checked the csv output and noticed that:

file1 - contains text i wanted here
file2 - contains file 1 + text i wanted here
file3 - contains file 2 + text i wanted here
and so on.
I'm using the same formula to extract the text from the website, the folder location is the same and that's about the place where similiarities end.

from what i understood on the iMacros wiki - extract is reset every time u save the data to a file, however from this behaviour here i would say it's not doing that.

did i misunderstood the explanations on the wiki?

I'm not sure sample code would do you any good, website requires login in order to work.
User avatar
Tech Support
Posts: 4947
Joined: Tue Sep 20, 2005 7:25 pm
Contact:

Post by Tech Support » Sun May 20, 2007 3:33 pm

Hi,

I confirmed this issue. It works correctly in iMacros for IE, but not in iMacros for Firefox. It will be fixed ASAP.
kawokgy
Posts: 1
Joined: Thu Jul 14, 2011 6:28 pm

Re: iMacros not resetting extract variable on save to file o

Post by kawokgy » Thu Jul 14, 2011 6:30 pm

Is this issue already resolved with Firefox iMacros? Still appears as a problem in my case.
Komano
Posts: 7
Joined: Tue Nov 15, 2011 8:44 am

Re: iMacros not resetting extract variable on save to file o

Post by Komano » Thu Nov 17, 2011 5:54 am

I confirm that this is still an issue. Apparently ASAP means 3 years and more.
Hannes, Tech Support

Re: iMacros not resetting extract variable on save to file o

Post by Hannes, Tech Support » Thu Nov 17, 2011 2:19 pm

Could you post a macro that we can use to recreate this issue?
Komano
Posts: 7
Joined: Tue Nov 15, 2011 8:44 am

Re: iMacros not resetting extract variable on save to file o

Post by Komano » Thu Nov 17, 2011 3:33 pm

Code: Select all

TAB=1
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:form1 ATTR=ID:TF2 EXTRACT=TXT
SET !VAR1 {{!EXTRACT}}
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:f1 ATTR=NAME:n1 CONTENT={{!VAR1}}
TAB=2
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:form1 ATTR=ID:TF2 EXTRACT=TXT
SET !VAR1 {{!EXTRACT}}
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:f1 ATTR=NAME:n1 CONTENT={{!VAR1}}
I think that's what i used if i remember correctly.
Hannes, Tech Support

Re: iMacros not resetting extract variable on save to file o

Post by Hannes, Tech Support » Fri Nov 18, 2011 9:50 am

Thanks!
Now, what should happen when running your macro, and what happens instead? !VAR1 has the wrong content?
Komano
Posts: 7
Joined: Tue Nov 15, 2011 8:44 am

Re: iMacros not resetting extract variable on save to file o

Post by Komano » Fri Nov 18, 2011 1:32 pm

For Example the first text box i have the text "TEST"

it will copy the word "TEST" correctly to the second textbox for the first tab.

However, for the second tab, it will copy the word "TEST" again.

But this time, it will copy it wrongly with contents of the first "EXTRACT" and i will get "TEST [EXTRACT] TEST"

and for the third i believe its "TEST [EXTRACT] TEST [EXTRACT] TEST" and so on and so forth. If i remember correctly*

EDIT:

For people who want to copy contents from one box to another and need to do it in multiple tabs then you can use the code below. It basically does it for you in the first tab and then it switches focus to the second tab then you'll have to press "play" again but at least you don't have to switch the tabs manually.

Code: Select all

VERSION BUILD=7401004 RECORDER=FX
SET !EXTRACT_TEST_POPUP NO
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:save ATTR=ID:englishTitle EXTRACT=TXT
SET !VAR1 {{!EXTRACT}}
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:save ATTR=ID:merchantName CONTENT={{!VAR1}}
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:save ATTR=ID:title CONTENT={{!VAR1}}
TAB T=2
Hannes, Tech Support

Re: iMacros not resetting extract variable on save to file o

Post by Hannes, Tech Support » Mon Nov 21, 2011 7:36 am

Thanks for the additional information!

You are right: the value of {{!EXTRACT}} is not reset on every extraction. But this is on purpose so you can extract several items, and then save the whole bunch as CSV (via SAVEAS).

In order to overcome your issue, use "SET !EXTRACT NULL" between the extract-and-fill parts, like here:

Code: Select all

VERSION BUILD=7401110 RECORDER=FX
TAB T=1
URL GOTO=http://www.amazon.com/
TAG POS=1 TYPE=SPAN ATTR=TXT:Hello. EXTRACT=TXT
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:site-search ATTR=ID:twotabsearchtextbox CONTENT={{!EXTRACT}}
'clear !EXTRACT value
SET !EXTRACT NULL
TAG POS=1 TYPE=SPAN ATTR=TXT:Hello. EXTRACT=TXT
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:site-search ATTR=ID:twotabsearchtextbox CONTENT={{!EXTRACT}}
Komano
Posts: 7
Joined: Tue Nov 15, 2011 8:44 am

Re: iMacros not resetting extract variable on save to file o

Post by Komano » Wed Nov 23, 2011 7:26 am

Thanks!

Was wondering if it was possible to reset the variable to null or something. :p
Post Reply