Help needed for a beginners problem

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 Google search box (at the top of each forum page) to see if a similar problem or question has already been addressed. This will search the entire contents of the forums as well as the iMacros Wiki.
3. We can respond much faster to your posts if you include the following information:

CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST

Answering your own posts (e.g. attempting to "bump" your topic) drops your topic from the list of unanswered threads, so it may actually receive less views.
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