Re: script differences ?
Re: script differences ?
- Subject: Re: script differences ?
- From: Shane Stanley <email@hidden>
- Date: Sun, 11 Oct 2015 23:30:09 +1100
On 11 Oct 2015, at 11:15 PM, Jean-Christophe Helary <email@hidden> wrote:
I'd like to know what is technically different between the two approaches. Is the second one "better" ? If yes, why ? What is there to learn from the approach adopted in the second one ? Is there anything wrong with the first approach ?
Neither is better or worse. Generally, the "with properties" approach is a bit faster, especially if there are several properties involved. In some cases it is required -- for example, where the property cannot be changed once the object is created.
It can also be useful in other ways. For example, suppose you have a folder on your desktop called 'Some test folder'. If you run this:
tell application "Finder" make folder at desktop with properties {name:"Some test folder"} end tell
you get an error. If you run this:
tell application "Finder" set theFolder to make folder at desktop set name of theFolder to "Some test folder" end tell
you get an error, and you're also left with an untitled folder. |
_______________________________________________
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