how can i upload a random files in the folder [SOLVED]

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 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
mohanjackie
Posts: 9
Joined: Thu Aug 25, 2016 10:20 am

how can i upload a random files in the folder [SOLVED]

Post by mohanjackie » Tue Aug 30, 2016 1:31 pm

I want to update random profile picture to my facebook from the folder, Struggling from day and night Not getting the code to upload a image/.jepg on facebook anyone please crack this.


VERSION BUILD=8970419 RECORDER=FX
win10
Firefox v47
Last edited by mohanjackie on Wed Aug 31, 2016 10:37 am, edited 1 time in total.
iimfun
Posts: 239
Joined: Tue Jul 19, 2016 1:06 pm

Re: how can i upload a random files in the folder

Post by iimfun » Tue Aug 30, 2016 2:49 pm

I've seen a number of similar posts on the stackoverflow forum. Check it out. Hope you can find a good answer there.
mohanjackie
Posts: 9
Joined: Thu Aug 25, 2016 10:20 am

Re: how can i upload a random files in the folder

Post by mohanjackie » Wed Aug 31, 2016 7:56 am

Thank you iimfun for the replay, BTW your facebook filling code worked well and helped me a lot for saving time :)

i searched some of the imacros and got this code,

the code uploads image but, but uploaded image doesn't show up or it says please upload jpg or png format (image is jpg format)

something is wrong with the code, please correct me

image names are saved as 1,2,3,4...........

it is a .js
i have saved in js format

Code: Select all

Math.floor(Math.random()*11+1)
X=11;
  iimPlay("CODE:TAG POS=2 TYPE=INPUT:FILE ATTR=* CONTENT=C:\Users\macros\Downloads\facebookjpgtesting\1\1.JPG"+Math.floor(Math.random()*X+1)+".JPG");
mohanjackie
Posts: 9
Joined: Thu Aug 25, 2016 10:20 am

Re: how can i upload a random files in the folder [SOLVED]

Post by mohanjackie » Wed Aug 31, 2016 10:36 am

[SOLVED]

It was easy as I work on it

First of all rename all the files in the Folder like file1,file2,file3,file4.....ect,.

Code: Select all

SET !VAR1 EVAL("var randomNumber=Math.floor(Math.random()*10 + 1); randomNumber;")
TAG POS=1 TYPE=INPUT:FILE ATTR=NAME:photo CONTENT=C:\in\file{{!VAR1}}.jpg
Post Reply