• 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: copy files
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: copy files


  • Subject: Re: copy files
  • From: Joe <email@hidden>
  • Date: Tue, 3 Jun 2008 22:14:09 -0700

David G. Kahn wrote:

Could anyone help me with trying to copy different files from one folder to different locations.

Ex) File 1, File 2, File 3. Copy File 1 to Applications, copy file 2 to Desktop, copy file 3 to /tmp

Mark J. Reed wrote:

The general syntax is

tell application "Finder"
    copy file (file to copy) to folder (folder to copy into)
end tell

The actual form of the parenthesized parts depends mostly on how your
script learns what it's supposed to copy and where.

Has this action always used "copy" as the command? I dimly recollect needing to use "duplicate" rather than "copy" some eons ago.


This works fine:

tell app "Finder"
copy file "HD:Folder A:File A" to folder "HD:Folder B:"
end tell

This fails:

tell app "Finder"
copy file "HD:Folder A:File A" to alias "HD:Folder B:"
end tell
--->Can’t make «class docf» "File A" of «class cfol» of «class sdsk» of application "Finder" into the expected type.


While this works with 'mixed' reference types:

tell app "Finder"
duplicate file "HD:Folder A:File A" to alias "HD:Folder B:"
end tell

--
Joe _______________________________________________
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
  • Prev by Date: Sending TEXT values in Apple Events with AppleScript 2.0
  • Next by Date: Re: copy files
  • Previous by thread: Re: copy files
  • Next by thread: Re: copy files
  • Index(es):
    • Date
    • Thread