Re: get Applescript to act on a file once it has been downloaded
Re: get Applescript to act on a file once it has been downloaded
- Subject: Re: get Applescript to act on a file once it has been downloaded
- From: Thomas Fischer <email@hidden>
- Date: Fri, 11 Jul 2014 16:50:11 +0200
Hi William,
> set newfile to "/Volumes/FIS/Customer/CLIENTNAME/2015_Ads/Test/" & newFileName & ".eps"
>
> tell application "Finder"
> activate
> repeat while not (exists POSIX file newfile)
> delay 0.5
> end repeat
> end tell
>
> results in an endless repeating of:
>
> exists POSIX file "/Volumes/FIS/Customer/CLIENTNAME/2015_Ads/Test/BT150453.eps"
> --> false
I love these AppleScript idiosyncrasies!
I have a file
"/Volumes/share/Fischer/Heike.doc"
and try
set newfile to "/Volumes/share/Fischer/Heike.doc"
tell application "Finder" to exists (POSIX file newfile)
--> false
tell application "Finder" to exists POSIX file "/Volumes/share/Fischer/Heike.doc"
--> true
The reason seems to be that the finder is not willing or able to evaluate two expressions at the same time, the solution might be:
set newfile to "/Volumes/share/Fischer/Heike.doc"
set myFile to POSIX file newfile
tell application "Finder" to exists myFile
--> true
So in your case:
set newfile to "/Volumes/FIS/Customer/CLIENTNAME/2015_Ads/Test/" & newFileName & ".eps"
set testFile to POSIX file newfile
tell application "Finder"
activate
repeat while not (exists testFile)
delay 0.5
end repeat
end tell
Hope this helps.
Best
Thomas
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden