• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: get Applescript to act on a file once it has been downloaded
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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: Shane Stanley <email@hidden>
  • Date: Sat, 12 Jul 2014 13:36:29 +1000

On 12 Jul 2014, at 12:15 am, William Adams <email@hidden> wrote:

tell application "Finder"
activate
repeat while not (exists POSIX file newfile)
delay 0.5
end repeat
end tell

There's really no need to get the Finder involved at all. You can instead try to coerce to an alias; it will only succeed if the file exists. So:

repeat
try
set newfileAlias to (POSIX file newfile) as alias
exit repeat
on error
delay 0.5
end try
end repeat
-- do something with newfileAlias here

now I need to puzzle out why the file doesn't get copied by a later block.

Just because a file exists, doesn't mean it's been fully downloaded.

-- 
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>

 _______________________________________________
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

  • Follow-Ups:
    • Re: get Applescript to act on a file once it has been downloaded
      • From: Christopher Stone <email@hidden>
References: 
 >get Applescript to act on a file once it has been downloaded (From: William Adams <email@hidden>)

  • Prev by Date: Re: get Applescript to act on a file once it has been downloaded
  • Next by Date: Re: get Applescript to act on a file once it has been downloaded
  • Previous by thread: Re: get Applescript to act on a file once it has been downloaded
  • Next by thread: Re: get Applescript to act on a file once it has been downloaded
  • Index(es):
    • Date
    • Thread