• 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: Modified "modification date"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Modified "modification date"


  • Subject: Re: Modified "modification date"
  • From: Luther Fuller <email@hidden>
  • Date: Fri, 11 Dec 2009 08:15:08 -0600

On Dec 10, 2009, at 10:39 PM, ba95 wrote:
Could you explain the command line a little more so that I can use it, please ?

Here is the complete handler ...

on copyFile(fileAlias, targetAlias, newFileName)
-- fileAlias is an alias to the source file, targetAlias is an alias to the destination folder and newFileName is a string
set sourcePath to (quoted form of POSIX path of fileAlias)
set targetPath to (quoted form of (POSIX path of ((targetAlias as text) & newFileName)))
try
do shell script "cp -np " & sourcePath & space & targetPath
return ((targetAlias as text) & newFileName) as alias
end try
return {}
end copyFile --------------------------------------------------------------------

I use it only for copying files, never folders, so you should pay close attention to Axel's comments regarding folders. This handler preserves "all" properties, but not the Finder comment.

I, too, am afflicted with shell scripting "innocence", but sometimes they are necessary. I used this because 'duplicate' is unable to create the new file with the new name that my script has already created. Using 'cp' avoids a possible file name collision and takes advantage of my prior knowledge of newFileName.

 _______________________________________________
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: 
 >Re: Modified "modification date" (From: ba95 <email@hidden>)

  • Prev by Date: Re: Modified "modification date"
  • Next by Date: Re: New Folder Needs Password
  • Previous by thread: Re: Modified "modification date"
  • Next by thread: Re: Modified "modification date"
  • Index(es):
    • Date
    • Thread