• 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: Duplicate instead of Delete files in the list
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Duplicate instead of Delete files in the list


  • Subject: Re: Duplicate instead of Delete files in the list
  • From: LuKreme <email@hidden>
  • Date: Thu, 31 Dec 2009 15:35:33 -0700

On 29-Dec-2009, at 13:07, Nellyann Rosario wrote:
>        tell me to deleteFileFolder({rpTarget:theList})

This calls the function that deletes the files, so you will want to replace this with a function to copy the files  instead of deleting them. At it's simplest, something like:

on CopyFileFolder(FileList)
  set theTargetPath to "Disk:path:to:target:"
  try
    repeat with theFile in Filelist
      tell finder to copy theFile to theTargetPath
    end repeat
  end try
end

Of course, you'll need to test that and probably rework it, but logically that's about all.

The original script has a lot of logging and error trapping and extra stuff in it which you can, if you want, try to duplicate.

>                set theShellScript to "rm -r " & targetList
>                do shell script theShellScript

this is the heart of the script. If you want to keep the script intact you could just change this to

set theShellScript to "/bin/cp " & targetList & " " & theTargetPath
do shell script theShellScript

however, keep in mind that this (and the original) will fail if the list of files is too long. it looks ilk the original script breaks the list into individual files, but I don't really look too much at the logic to confirm that.

--
"He has never been known to use a word that might send a reader
    to the dictionary." - William Faulkner (about Ernest Hemingway).

 _______________________________________________
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

References: 
 >Duplicate instead of Delete files in the list (From: Nellyann Rosario <email@hidden>)

  • Prev by Date: Duplicate instead of Delete files in the list
  • Previous by thread: Duplicate instead of Delete files in the list
  • Index(es):
    • Date
    • Thread