Help needed for a beginners problem

Discussions and Tech Support specific to the iMacros Firefox add-on.
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
Post Reply
Jens4711
Posts: 2
Joined: Mon Nov 18, 2013 12:31 pm

Help needed for a beginners problem

Post by Jens4711 » Mon Nov 18, 2013 12:44 pm

Hi,

I have a script that gets an input value on each loop. With this value it has to do a certain task. The general task works fine, but at the end of the script it should do the following:

No Errors ==> add the input value to the file "accounts_finished.csv"
ERRORS in process ==> add the input value to the file "ERRORS.csv"

Right now the script writes all input values to both files - which doesn't help me. I can't get it to write to one or the other file depending on the fact if errors occurred or not.

The input values look like this

324
34E2,
JUN3,
07W,
jsje, <---- ERROR for testing
0LC,
0WP,
10J,
1AX,

where no. 5 is an error for sure.

The script looks like this:

Code: Select all

VERSION BUILD=8510617 RECORDER=FX
TAB T=1
TAB CLOSEALLOTHERS
SET !FOLDER_DATASOURCE C:\Users\ABC\Documents\iMacros\Macros\
SET !DATASOURCE Ticker-Symbols_2.csv
SET !DATASOURCE_COLUMNS 1
SET !LOOP 1
SET !DATASOURCE_LINE {{!LOOP}}
URL GOTO=http://de.finance.yahoo.com/q/hp?s=YHOO
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/q/hp ATTR=ID:pageTicker CONTENT={{!COL1}}
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ACTION:/q/hp ATTR=*
ONDOWNLOAD FOLDER=C:\Users\ABC\Documents\iMacros\Macros\Ergebnisse\ FILE={{!COL1}}_{{!NOW:yyyymmdd}}.csv WAIT=YES
SET !TIMEOUT_STEP 1
SET !ERRORIGNORE YES
TAG POS=1 TYPE=STRONG ATTR=TXT:Aufbereitet<SP>für<SP>Tabellenkalkulationsprogramm
SET !ERRORIGNORE NO
SET !TIMEOUT_STEP 3
 
Set !extract {{!NOW}}
add !extract {{!COL1}}
SAVEAS TYPE=EXTRACT FOLDER=C:\Users\ABC\Documents\iMacros\Macros\ FILE=accounts_finished.csv

SET !VAR1 EVAL("var x = 1; x;")
Set !extract {{!NOW}}
Set !EXTRACT NULL
ADD !EXTRACT {{!VAR1}}
SAVEAS TYPE=EXTRACT FOLDER=C:\Users\ABC\Documents\iMacros\Macros\ FILE=ERRORS_{{!NOW:yyyymmdd}}.csv
I really appreciate your help. Many thanks.
Post Reply