System Events duplicate command
System Events duplicate command
- Subject: System Events duplicate command
- From: Luther Fuller <email@hidden>
- Date: Thu, 20 Aug 2009 13:00:41 -0500
I recently complained that ...
tell application "System Events" duplicate aFile to destinationFolder with properties {name:newName} end tell
ignores the phrase 'with properties { ... }'. (bug?)
My work-around was to use this 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 -n -p " & sourcePath & space & targetPath return ((targetAlias as text) & newFileName) as alias end try return {} end copyFile
It seems to do exactly what I need. Does anyone with more unix experience than I see any problems here?
|
_______________________________________________
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