• 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
get Applescript to act on a file once it has been downloaded
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

get Applescript to act on a file once it has been downloaded


  • Subject: get Applescript to act on a file once it has been downloaded
  • From: William Adams <email@hidden>
  • Date: Fri, 11 Jul 2014 10:15:34 -0400

I'm downloading a file w/ the command:

set newfile to "/Volumes/FIS/Customer/CLIENTNAME/2015_Ads/Test/" & newFileName & ".eps"

set download_path to "ftp://"; & ftpUserName & ":" & ftpPassword & "@" & ftpHost & "//" & "o7/" & ftpSubDirectory & "/" & ftpSourceDirectory & "/" & originalFileName & ".eps"

do shell script "curl -o " & quoted form of newfile & " " & quoted form of download_path

and the file downloads fine.

Attempting to access it as an alias the fails though, and trying to get the script to wait for the file to appear using:

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
	exists POSIX file "/Volumes/FIS/Customer/CLIENTNAME/2015_Ads/Test/BT150453.eps"
		--> false

Even though I can see the file in Finder.

How does one get Applescript to:

 - wait for a file to be downloaded completely
 - act on the file once it is present (I need to copy it to a folder, then re-upload it under a new name)

William



--
William Adams
senior graphic designer
Fry Communications
Sphinx of black quartz, judge my vow.


 _______________________________________________
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: Shane Stanley <email@hidden>
    • Re: get Applescript to act on a file once it has been downloaded
      • From: Christopher Stone <email@hidden>
    • Re: get Applescript to act on a file once it has been downloaded
      • From: "koenig.yvan" <email@hidden>
    • Re: get Applescript to act on a file once it has been downloaded
      • From: Thomas Fischer <email@hidden>
  • Prev by Date: Re: Script won't run consistently
  • Next by Date: Re: get Applescript to act on a file once it has been downloaded
  • Previous by thread: Help scripting configuration and customization for multiple installs
  • Next by thread: Re: get Applescript to act on a file once it has been downloaded
  • Index(es):
    • Date
    • Thread