Multiple Files Upload to Google Photos

Discussions and Tech Support related to the iMacros Firefox Add-on, including the built-in Javascript scripting interface for playing .js files.

Moderators: Community Moderators, iMacros Moderators

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.

Multiple Files Upload to Google Photos

by mav3r1x on Sat Jun 17, 2017 6:06 am

Uploading one file using code below works fine:

Code: Select all
TAB T=1
URL GOTO=https://photos.google.com/albums
TAG POS=1 TYPE=SPAN ATTR=TXT:Upload
TAG POS=2 TYPE=INPUT:FILE ATTR=TYPE:file CONTENT=C:/video.mp4
WAIT SECONDS=4


I modified the code to below to upload multiple files. But it doesn't work. Code finishes saying okay but nothing is uploaded.


Code: Select all
TAB T=1
TAB CLOSEALLOTHERS
SET !DATASOURCE upload.txt
SET !DATASOURCE_COLUMNS 1
SET !DATASOURCE_LINE {{!LOOP}}
SET !PLAYBACKDELAY 0.2
URL GOTO=https://photos.google.com/albums
TAG POS=1 TYPE=SPAN ATTR=TXT:Upload
TAG POS=2 TYPE=INPUT:FILE ATTR=TYPE:file CONTENT={{!COL1}}
WAIT SECONDS=4


What am I doing wrong?

Edit: Just to let you know that I might have posted in the wrong sub forum. I am using iMacros Browser VERSION BUILD=11.5.497.9113 not Firefox.
Last edited by mav3r1x on Sun Jun 18, 2017 12:27 am, edited 2 times in total.
mav3r1x
 
Posts: 9
Joined: Sat Jun 17, 2017 5:59 am

Re: Multiple Files Upload to Google Photos

by chivracq on Sat Jun 17, 2017 7:27 am

mav3r1x wrote:Uploading one file using code below works fine:

Code: Select all
TAB T=1
URL GOTO=https://photos.google.com/albums
TAG POS=1 TYPE=SPAN ATTR=TXT:Upload
TAG POS=2 TYPE=INPUT:FILE ATTR=TYPE:file CONTENT=C:/video.mp4
WAIT SECONDS=4


I modified the code to below to upload multiple files. But it doesn't work. Code finishes saying okay but nothing is uploaded.

Code: Select all
TAB T=1
TAB CLOSEALLOTHERS
SET !DATASOURCE upload.txt
SET !DATASOURCE_COLUMNS 1
SET !DATASOURCE_LINE {{!LOOP}}
SET !PLAYBACKDELAY 0.2
URL GOTO=https://photos.google.com/albums
TAG POS=1 TYPE=SPAN ATTR=TXT:Upload
TAG POS=2 TYPE=INPUT:FILE ATTR=TYPE:file CONTENT={{!COL1}}
WAIT SECONDS=4


What am I doing wrong?

=> ... Not mentioning your FCI...! :mrgreen: (Read my Sig...)
You are posting in the 'iMacros for FF' Sub-Forum meaning your Pb is specific to only FF and that your Script works in other Browsers (or if you were using a '.js' Script, which is not the case) but you don't even mention your FCI... :roll: (But no need to duplicate..., try to select the correct Sub-Forum next time...)
And yep, you are using a Command which is not supported on FF ('!PLAYBACKDELAY') but you should get a clear RuntimeError (about "not supported Parameter") if you try to run this Script in FF...

The File Upload Functionality is btw not supported anymore on v9.0.3 for FF, but your first Script would fail as well if you were using this Version...
=> Can you first mention clearly your FCI...?

And most Browsers prevent Access to the 'C:\' Root, I'm nearly surprised your first Script "works" with a "C:\video.mp4" (hum, or "C:/video.mp4" if you prefer to use Forward Slashes, which should be OK...)...
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 5730
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Multiple Files Upload to Google Photos

by mav3r1x on Sat Jun 17, 2017 9:47 am

chivracq wrote:=> ... Not mentioning your FCI...! :mrgreen: (Read my Sig...)
You are posting in the 'iMacros for FF' Sub-Forum meaning your Pb is specific to only FF and that your Script works in other Browsers (or if you were using a '.js' Script, which is not the case) but you don't even mention your FCI... :roll: (But no need to duplicate..., try to select the correct Sub-Forum next time...)
And yep, you are using a Command which is not supported on FF ('!PLAYBACKDELAY') but you should get a clear RuntimeError (about "not supported Parameter") if you try to run this Script in FF...

The File Upload Functionality is btw not supported anymore on v9.0.3 for FF, but your first Script would fail as well if you were using this Version...
=> Can you first mention clearly your FCI...?

And most Browsers prevent Access to the 'C:\' Root, I'm nearly surprised your first Script "works" with a "C:\video.mp4" (hum, or "C:/video.mp4" if you prefer to use Forward Slashes, which should be OK...)...


Hey it's my first time,, so please. I am using iMacros Browser VERSION BUILD=11.5.497.9113.
Btw I kinda knew I was posting in the wrong section but wasn't sure. I figured moderators would move it to the appropriate section.

So now that is clear, let's figure out the actual problem. Can you help me out?
mav3r1x
 
Posts: 9
Joined: Sat Jun 17, 2017 5:59 am

Re: Multiple Files Upload to Google Photos

by chivracq on Sat Jun 17, 2017 10:15 am

mav3r1x wrote:Hey it's my first time,, so please. I am using
Code: Select all
iMacros Browser VERSION BUILD=11.5.497.9113.

Btw I kinda knew I was posting in the wrong section but wasn't sure. I figured moderators would move it to the appropriate section.

So now that is clear, let's figure out the actual problem. Can you help me out?

Yep, good-good for FCI... Moving Threads is always a bit of a hassle, can only be done by the Forum Admin who only checks the Forum from time to time, and when a Thread is moved, some Users cannot find their Thread anymore, will recreate a Duplicate, which is even more hassle, ah-ah...!

WE is starting for me now, don't have time anymore to look at your Pb, I'll check tomorrow again...
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 5730
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Multiple Files Upload to Google Photos

by mav3r1x on Sat Jun 17, 2017 10:37 am

chivracq wrote:Yep, good-good for FCI... Moving Threads is always a bit of a hassle, can only be done by the Forum Admin who only checks the Forum from time to time, and when a Thread is moved, some Users cannot find their Thread anymore, will recreate a Duplicate, which is even more hassle, ah-ah...!

WE is starting for me now, don't have time anymore to look at your Pb, I'll check tomorrow again...


Fine.will wait for your post tomorrow.
mav3r1x
 
Posts: 9
Joined: Sat Jun 17, 2017 5:59 am

Re: Multiple Files Upload to Google Photos

by mav3r1x on Sun Jun 18, 2017 12:26 am

@chivracq , Did you get a chance to take a look at it?
mav3r1x
 
Posts: 9
Joined: Sat Jun 17, 2017 5:59 am

Re: Multiple Files Upload to Google Photos

by chivracq on Sun Jun 18, 2017 5:25 am

mav3r1x wrote:@chivracq , Did you get a chance to take a look at it?

Nope, just back from my (late, oops...) "Evening", I guess I first need a bit of sleep... :wink:
(I'm a DJ IRL, so WE's are always a bit "busy" for me, hum and I have some other big Concert tonight at some crazy place where I want to go and where I usually end up DJ'ing all night, so that Evening might end up "a bit late" as well, but I'll try to have a look at your Thread before..., well if new Threads don't come up, you should have done "things' correctly directly, I had some/more time yesterday afternoon...)
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 5730
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Multiple Files Upload to Google Photos

by mav3r1x on Sun Jun 18, 2017 5:53 am

chivracq wrote:
mav3r1x wrote:@chivracq , Did you get a chance to take a look at it?

Nope, just back from my (late, oops...) "Evening", I guess I first need a bit of sleep... :wink:
(I'm a DJ IRL, so WE's are always a bit "busy" for me, hum and I have some other big Concert tonight at some crazy place where I want to go and where I usually end up DJ'ing all night, so that Evening might end up "a bit late" as well, but I'll try to have a look at your Thread before..., well if new Threads don't come up, you should have done "things' correctly directly, I had some/more time yesterday afternoon...)


LOl. I was looking at your profile earlier to see when you was online last, and I saw all that. I thought this guy is pretty busy.

But an hour ago I found this tutorial by Tom: viewtopic.php?f=6&t=23209

Seems to work for Google Photos too. So problem solved.
But there is an another issue now. I need the script to wait until upload is finished and then loop. Is it possible in iMacros???
Appreciate your time btw.
mav3r1x
 
Posts: 9
Joined: Sat Jun 17, 2017 5:59 am

Re: Multiple Files Upload to Google Photos

by chivracq on Sun Jun 18, 2017 6:36 am

mav3r1x wrote:LOl. I was looking at your profile earlier to see when you was online last, and I saw all that. I thought this guy is pretty busy.

But an hour ago I found this tutorial by Tom: viewtopic.php?f=6&t=23209

Seems to work for Google Photos too. So problem solved.
But there is an another issue now. I need the script to wait until upload is finished and then loop. Is it possible in iMacros???
Appreciate your time btw.

Yep, ah-ah...!

But OK, good if Tom's Method for 'ebay' works as well for your Site...

If you want your Script to wait until the Upload is finished, you can either add some some hard-coded 'WAIT' Statement, or maybe "more clever", if any "Confirmation" is displayed on the Page like "Your File(s) has/have been uploaded..." or your Image(s) get(s) displayed, is to tag it with a long '!TIMEOUT_STEP' Value (like "300" for 5 min for example) and your Script will wait until this HTML Element appears before continuing... :idea:
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 5730
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Multiple Files Upload to Google Photos

by mav3r1x on Sun Jun 18, 2017 7:00 am

chivracq wrote:
mav3r1x wrote:LOl. I was looking at your profile earlier to see when you was online last, and I saw all that. I thought this guy is pretty busy.

But an hour ago I found this tutorial by Tom: viewtopic.php?f=6&t=23209

Seems to work for Google Photos too. So problem solved.
But there is an another issue now. I need the script to wait until upload is finished and then loop. Is it possible in iMacros???
Appreciate your time btw.

Yep, ah-ah...!

But OK, good if Tom's Method for 'ebay' works as well for your Site...

If you want your Script to wait until the Upload is finished, you can either add some some hard-coded 'WAIT' Statement, or maybe "more clever", if any "Confirmation" is displayed on the Page like "Your File(s) has/have been uploaded..." or your Image(s) get(s) displayed, is to tag it with a long '!TIMEOUT_STEP' Value (like "300" for 5 min for example) and your Script will wait until this HTML Element appears before continuing... :idea:


Yep. Got it working. thanks.
I am using TAG command to click on text "1 item uploaded".
!TIMEOUT_STEP is set to 10 minutes.

One more thing, just for information. How would I go about using image detection command instead of waiting for text "1 item uploaded". ?
mav3r1x
 
Posts: 9
Joined: Sat Jun 17, 2017 5:59 am

Re: Multiple Files Upload to Google Photos

by chivracq on Sun Jun 18, 2017 8:20 am

mav3r1x wrote:Yep. Got it working. thanks.
I am using TAG command to click on text "1 item uploaded".
!TIMEOUT_STEP is set to 10 minutes.

One more thing, just for information. How would I go about using image detection command instead of waiting for text "1 item uploaded". ?

Well, check the Wiki for 'IMAGESEARCH', it looks neatly explained to me, I would think... But I've never used it as it is not supported by (the Free) iMacros for FF (Add-on)...
I usually try to avoid Commands that are not cross-Browser supported, well..., except for the 'EVENT' Mode when it was only implemented on FF...
'IMAGESEARCH' might be a bit "slow" I reckon, but I guess that wouldn't be a Pb for you as you are already willing to wait for 10 min for the Upload ah-ah...!
But hum, I think I would rather go for a long '!TIMEOUT_STEP' again and trying to tag that Image (with Wildcards and/or Relative Positioning probably and you can automatically increment its 'POS' from some Check before the Upload, if necessary...) + maybe with some 'EXTRACT=HREF or HTM', then use 'EVAL()' for some Check if you want... You only have 30 days for the Trial on iMB v11.5, it might be "wiser" not to use Commands that only work in iMB... That Method is probably more reliable and useful than 'IMAGESEARCH' I would think, which only returns the '!IMAGEX/Y' Coordinates which I guess you won't reuse for anything... (And it will work in all Browsers...!) :idea:
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 5730
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Multiple Files Upload to Google Photos

by mav3r1x on Sun Jun 18, 2017 9:20 am

chivracq wrote:
mav3r1x wrote:Yep. Got it working. thanks.
I am using TAG command to click on text "1 item uploaded".
!TIMEOUT_STEP is set to 10 minutes.

One more thing, just for information. How would I go about using image detection command instead of waiting for text "1 item uploaded". ?

Well, check the Wiki for 'IMAGESEARCH', it looks neatly explained to me, I would think... But I've never used it as it is not supported by (the Free) iMacros for FF (Add-on)...
I usually try to avoid Commands that are not cross-Browser supported, well..., except for the 'EVENT' Mode when it was only implemented on FF...
'IMAGESEARCH' might be a bit "slow" I reckon, but I guess that wouldn't be a Pb for you as you are already willing to wait for 10 min for the Upload ah-ah...!
But hum, I think I would rather go for a long '!TIMEOUT_STEP' again and trying to tag that Image (with Wildcards and/or Relative Positioning probably and you can automatically increment its 'POS' from some Check before the Upload, if necessary...) + maybe with some 'EXTRACT=HREF or HTM', then use 'EVAL()' for some Check if you want... You only have 30 days for the Trial on iMB v11.5, it might be "wiser" not to use Commands that only work in iMB... That Method is probably more reliable and useful than 'IMAGESEARCH' I would think, which only returns the '!IMAGEX/Y' Coordinates which I guess you won't reuse for anything... (And it will work in all Browsers...!) :idea:


I tried it with IMAGESEARCH and you are right it does take more time than TAG command. And also I don't know if it's reliable and work each time.
I am running the script on a server so no time wasted :mrgreen: It's gonna run for like 3 days, I guess.
This is the first time I am using iMacros ( in fact any automation tool ) and I am already hooked!
Thanks for all your time and help.
Hapy DJ'ing :wink:
mav3r1x
 
Posts: 9
Joined: Sat Jun 17, 2017 5:59 am

Re: Multiple Files Upload to Google Photos

by chivracq on Sun Jun 18, 2017 7:43 pm

mav3r1x wrote:I tried it with IMAGESEARCH and you are right it does take more time than TAG command. And also I don't know if it's reliable and work each time.
I am running the script on a server so no time wasted :mrgreen: It's gonna run for like 3 days, I guess.
This is the first time I am using iMacros ( in fact any automation tool ) and I am already hooked!
Thanks for all your time and help.
Hapy DJ'ing :wink:

I discovered iMacros about 10 years ago myself while playing some "stupid" Game and I was hooked directly, hum..., probably because I won, and I still reuse that same Script every year when that Game takes place, and I still win each time, ah-ah...!

You sound like you are a bit "cleverly Creative" so I guess you will make some very nice Scripts with iMacros, I've never used iMB myself (the iMacros Browser), I prefer the Free Add-on for FF, which can run JavaScript '.js' Scripts as well (which I don't even use, I only use '.iim' Macros)...

But hum, concerning this current Thread, it would be nice if you could post/share your Final Script for uploading Files/Photos/Videos to Google Photos, I guess there must be other Users using this Google Photo thats will be happy to find this Script upon searching the Forum... :idea:
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 5730
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Multiple Files Upload to Google Photos

by mav3r1x on Mon Jun 19, 2017 12:50 pm

chivracq wrote:I discovered iMacros about 10 years ago myself while playing some "stupid" Game and I was hooked directly, hum..., probably because I won, and I still reuse that same Script every year when that Game takes place, and I still win each time, ah-ah...!

You sound like you are a bit "cleverly Creative" so I guess you will make some very nice Scripts with iMacros, I've never used iMB myself (the iMacros Browser), I prefer the Free Add-on for FF, which can run JavaScript '.js' Scripts as well (which I don't even use, I only use '.iim' Macros)...

But hum, concerning this current Thread, it would be nice if you could post/share your Final Script for uploading Files/Photos/Videos to Google Photos, I guess there must be other Users using this Google Photo thats will be happy to find this Script upon searching the Forum... :idea:


Web automation makes time consuming tasks so easy, you can just run the script and leave. iMacros makes it even cooler.

I first started with Firefox addon as well, but had to download trial version of iMacros browser as firefox addon doesn't support Upload File feature( which you mentioned as well in your earlier post).

And about the final script, I think others will find it useful. I tried it with google drive too and it works. So here it is:

Code: Select all
VERSION BUILD=11.5.498.2403
SET !TIMEOUT_STEP 6
SET !EXTRACT_TEST_POPUP NO
SET !ERRORIGNORE YES
SET !PLAYBACKDELAY 0.2
SET !DATASOURCE upload1.txt
SET !DATASOURCE_COLUMNS 1
SET !DATASOURCE_LINE {{!LOOP}}
TAB T=1
TAB CLOSEALLOTHERS
TAB OPEN
TAB T=2
TAB T=1
TAB CLOSE
TAB T=1
URL GOTO=https://photos.google.com/albums
WAIT SECONDS=3
TAG POS=1 TYPE=SPAN ATTR=TXT:Upload CONTENT={{!COL1}}
[code]SET !TIMEOUT_STEP 6000000
TAG POS=2 TYPE=DIV ATTR=TXT:1<SP>item<SP>uploaded
WAIT SECONDS=2[/code]


"upload multiple files to google drive/google photos".

Btw there is one more modification I would like to make in this script and that, I think, will require use of JS.
I need to use condition statement like this:

First it would run this part of script:
Code: Select all
VERSION BUILD=11.5.498.2403
SET !TIMEOUT_STEP 6
SET !EXTRACT_TEST_POPUP NO
SET !ERRORIGNORE YES
SET !PLAYBACKDELAY 0.2
SET !DATASOURCE upload1.txt
SET !DATASOURCE_COLUMNS 1
SET !DATASOURCE_LINE {{!LOOP}}
TAB T=1
TAB CLOSEALLOTHERS
TAB OPEN
TAB T=2
TAB T=1
TAB CLOSE
TAB T=1
URL GOTO=https://photos.google.com/albums
WAIT SECONDS=3
TAG POS=1 TYPE=SPAN ATTR=TXT:Upload CONTENT={{!COL1}}


and then it would check for text "preparing photos" on page. If it is there then run the next(following) part of the code ELSE repeat the same Loop again.

Code: Select all
SET !TIMEOUT_STEP 6000000
TAG POS=2 TYPE=DIV ATTR=TXT:1<SP>item<SP>uploaded
WAIT SECONDS=2


You mentioned that you don't use JS much, so I don't know whether you can help me or not but please do take a look and guide me in the right direction. I am a total noob when it comes to javascript use in imacros.
mav3r1x
 
Posts: 9
Joined: Sat Jun 17, 2017 5:59 am


Return to iMacros for Firefox

Who is online

Users browsing this forum: Bing [Bot] and 7 guests

Website Monitoring