iMacro Question

oToom

Newbie
Joined
Oct 4, 2009
Messages
24
Reaction score
1
If for instance I am uploading files to a website. And I get this from recording my action..

TAG POS=1 TYPE=INPUT:FILE FORM=ACTION://upload.*.com/ ATTR=NAME:media[] CONTENT=F:\Folder\FileName.jpg

If I was to say want to loop through 10 images. How would I go about doing this?
All the file names are different.

Thanks for any help.
 
SET !ERRORIGNORE YES
SET !DATASOURCE FILENAMES.csv
SET !DATASOURCE_COLUMNS 1000
SET !LOOP 1
TAG POS=1 TYPE=INPUT:FILE FORM=ACTION://upload.*.com/ ATTR=NAME:media[] CONTENT=F:\Folder\{{!COL1}}.jpg



Make a text or csv file and put all file names from folder to first row..if they are all .jpg if not then use{{!COL1}} instead {{!COL1}}.jpg and write full image name and extension in csv file.

Let me know if i can help you further. :) :)
 
Last edited:
Here is an example of a loop that I have used. Don't know if it helps.

SET !DATASOURCE C:\users.csv
SET !DATASOURCE_COLUMNS 1
'Start at line 2 to skip the header in the file
SET !LOOP 1
SET !DATASOURCE_LINE {{!LOOP}}
WAIT SECONDS=3
TAG POS=1 TYPE=SPAN ATTR=TXT:Follow
WAIT SECONDS=8
URL GOTO=https : // twitter . com /{{!COL1}}
WAIT SECONDS=4
 
Also if you can rename files to 1,2,3,4 etc then you do not need to use !DATASOURCE.

Just declare SET !VAR1 EVAL("Math.floor(Math.random()*10 + 1);") in starting of macro

and use !VAR1.jpg instead {{!COL1}}.jpg


Got it working?
 
Sorry have been busy today at work. Will give this a try in a minute.
Only problem is there is around 8000 images in the folder. I will be uploading 20 at a time. Or more. But would rather not upload 8000 names to a .csv file haha.

May look into python on how to change the names of files in a folder. Let it run through all the 8000 images incrementing the number like you say, 1,2,3,4 etc etc.
 
select all images in windows explorer and rename them all to same name eg IM


they will get renamed itself as

IM (1)
IM (2)
IM (3)
IM (4)

use IM<sp>({{!LOOP}}).jpg
I was also busy@
 
Last edited:
Superb mate thank you. Saves me learning python haha.
Wish I could afford uBot or something, But iMacros ff add-on is all I can do for now.

EDIT. For some reason when I try that it causes doubles.
IM (1)
IM (1)
IM (2)
IM (2). etc etc.
Menaing 2 files are called the same...
Didn't even think this was possible?
 
Last edited:
you are most welcome, let me know if i can do anything else
 
Figured the reason that it was making doubles with the same name was because one was .jpg one was .png. If there was a .gif it would make another with the same name.

Still haven't had time to test this but will try get round to it now haha. Thanks again I'll report back.
 
am really trying to post with all the data of my prblem wth my macros
but cant y?
 
Back
Top