• 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/Paste in the Finder
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Copy/Paste in the Finder


  • Subject: Re: Copy/Paste in the Finder
  • From: Zack Jarrett <email@hidden>
  • Date: Wed, 17 Nov 2010 12:21:50 -0700

Rather than use the clipboard you should use Finder's duplicate command in AppleScript to copy files around.  Assuming "photos" and "newphotos" are both folders on your desktop you can use something like this to copy the contents of photos to newphotos:

tell application "Finder"
set theFolder to (path to desktop as string) & "photos" as alias
set theItems to items of theFolder


set destinationFolder to (path to desktop as string) & "newphotos" as alias


repeat with aFile in theItems
duplicate aFile to destinationFolder
end repeat


end tell

Good luck!
Zack



On Nov 17, 2010, at 12:04 PM, Alex Ivanov wrote:

I manually select let's say 20 files in Finder and then I right click on the files and select "copy". Now those 20 files are placed in the clipboard.

What I want to do with apple script is "Paste" these files to a specific folder.

What I've done so far is a script that pastes a single file from clipboard:

tell application "Finder"
    set destination_folder to POSIX file "/Users/me/myfolder"
    copy file (the clipboard) to folder destination_folder
end tell

I get an error if in the clipboard is more than one file, but works ok for a single file.
How can I extend this script to paste more files from clipboard? I want also to do this in a single operation so that Finder won't open 20 copy progress dialogs.

Many thanks,
Alex

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: Copy/Paste in the Finder
      • From: Alex Ivanov <email@hidden>
References: 
 >Copy/Paste in the Finder (From: Alex Ivanov <email@hidden>)

  • Prev by Date: Copy/Paste in the Finder
  • Next by Date: Re: Copy/Paste in the Finder
  • Previous by thread: Copy/Paste in the Finder
  • Next by thread: Re: Copy/Paste in the Finder
  • Index(es):
    • Date
    • Thread