• 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
System Events duplicate command
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

System Events duplicate command


  • Subject: System Events duplicate command
  • From: Luther Fuller <email@hidden>
  • Date: Sun, 16 Aug 2009 20:27:54 -0500

The System Events dictionary states ...

duplicate v : Copy object(s) and put the copies at a new location.

duplicate specifier : the object for the command
[to location specifier] : The location for the new object(s).
[with properties record] : Properties to be set in the new duplicated object(s).

I am using ...

tell application "System Events"
duplicate aFile to destinationFolder with properties {name:newName}
end tell

in order to avoid a possible conflict of names. The string newName has been checked for compatibility before using the duplicate command. After an hour watching my script duplicate files with impossible names, I finally discovered that System Events' duplicate command simply ignores 'with properties {name: ...}' and duplicates the file with the original name.

(Insert expletives here)

I don't see how to avoid calling this a bug. Anyone know more?

 _______________________________________________
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: Re: Preventing POSIX File to Alias Conversion from Inserting Leading Colon
  • Next by Date: Value of insertion point as integer
  • Previous by thread: Re: Preventing POSIX File to Alias Conversion from Inserting Leading Colon
  • Next by thread: System Events duplicate command
  • Index(es):
    • Date
    • Thread