Overwrite Files

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
macrunning
Pro Scripter
Posts: 68
Joined: Wed May 04, 2005 10:24 pm

Overwrite Files

Post by macrunning » Thu May 05, 2005 3:42 pm

I have a script that downloads a zip file from the server and after it has downloaded is extracted to a particular folder on my harddrive. It runs great (thanks bob) but when one of the picture files already exists in that folder a pop up message asks if I want to overwrite this file. This is where my script is running into a problem. It will not finish executing if there is a pic file that already exists. It would run fine if no files already existed but such is not the case. So my question is how do I (if the message box pops up) continue running through the script. In other words extract the zip file of pics and if this message box pops up overwrite the files and if not just keep extracting the files to this folder?
Hope that made some sense. Excuse the newbie~!
Have a great day and thanks for any help anyone can provide.
-macrunning

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Thu May 05, 2005 3:55 pm

I see at least two options:

1. Before downloading do IfFileExists>..... and rename or delete file or stop downloading or any other way to respond. This will eliminate the "overwrite" window from coming up.

2. Modify script after download with WaitWindowOpen>......with a timeout that looks for the "overwrite window". If window opens then have script answer YES/NO and react accordingly.

My own choice would be the first one, only because it is easier.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

macrunning
Pro Scripter
Posts: 68
Joined: Wed May 04, 2005 10:24 pm

Maybe the second one

Post by macrunning » Thu May 05, 2005 4:29 pm

The first resolution sounds good but I don't know which pic files in the zip file I'm downloading are going to be duplicates in my destination folder. I will look at the second option and see if I can figure it out.
Thanks again bob and have a good one.
later,
macrunning

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts