Re: Double-quotes and Bar-quotes
Re: Double-quotes and Bar-quotes
- Subject: Re: Double-quotes and Bar-quotes
- From: Christopher Nebel <email@hidden>
- Date: Fri, 18 Sep 2009 15:52:48 -0700
On Sep 18, 2009, at 7:44 AM, Luther Fuller wrote: I just said ...
But, I can still use ...
tell application "System Events" to set value of property list item |ArchiveLastKnownLocation| of property list file (prefsFile as text) to the result
without error.
No I can't! It does not error, but it fails to write unless the bars are replaced with double-quotes.
So ... what's going on here?
You're confusing two very different uses of "quotes". The double quotes delimit a text constant, such as the name of a property list item. The bar quotes delimit an identifier that is, er, special in some way. [1] In the above sample, |ArchiveLastKnownLocation| is merely a variable, so I'm actually surprised that it doesn't just give you an "undefined variable" error.
--Chris Nebel AppleScript Engineering
[1] There are three possibilities: it contains otherwise illegal identifier characters, such as a hyphen; it conflicts with an application-defined terminology term, and you need it to be a user identifier (this turns up in AppleScriptObjC a fair bit); or it needs to be case-sensitive and contains uppercase letters (this shouldn't apply in 10.6; it handles things a bit differently so the problem doesn't arise). |
_______________________________________________
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