Reputation: 121
Only just started using iMacro today so bear with me.
I have an iMacro which opens a webpage and then a calendar icon is opened which looks like this:
I need to be able to iterate through each of these days and after each iteration it saves the webpage as a TXT file.
Currently I have this:
TAG POS=1 TYPE=IMG ATTR=ID:ctl00_ContentPlaceHolder1_imgDate
TAG POS=1 TYPE=DIV ATTR=ID:ctl00_ContentPlaceHolder1_calendarButtonExtender_day_0_0
WAIT SECONDS=10
SAVEAS TYPE=TXT FOLDER=/Users/morgannwg/Desktop FILE=1
The first line is clicking the calendar and the second line is selecting the day.
So day_0_0 would be the first item on the first row, day_0_1 would be the second item on the first row etc. etc.
I need a way for the iMacro to click every one of these dates for one month on the calendar and save each the page every time it loops through using some sort of loop rather than manually typing in every individual day.
If anybody can help I would really appreciate it.
Thank you!
G
Upvotes: 0
Views: 331
Reputation: 5299
I believe something like this will help you:
SET curRow EVAL("Math.floor(({{!LOOP}} - 1) / 7);")
SET curCol EVAL("(({{!LOOP}} % 7 == 0) ? 7 : {{!LOOP}} % 7) - 1;")
' comment the line below after debugging '
PROMPT {{curRow}}_{{curCol}}
TAG POS=1 TYPE=IMG ATTR=ID:ctl00_ContentPlaceHolder1_imgDate
TAG POS=1 TYPE=DIV ATTR=ID:ctl00_ContentPlaceHolder1_calendarButtonExtender_day_{{curRow}}_{{curCol}}
WAIT SECONDS=10
SAVEAS TYPE=TXT FOLDER=/Users/morgannwg/Desktop FILE=1_{{curRow}}_{{curCol}}
(The macro should be played in loop mode.)
Upvotes: 1