• 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: Double-quotes and Bar-quotes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Double-quotes and Bar-quotes
      • From: Luther Fuller <email@hidden>
References: 
 >Double-quotes and Bar-quotes (From: Luther Fuller <email@hidden>)

  • Prev by Date: Re: cron/Launchd Editor
  • Next by Date: Re: Double-quotes and Bar-quotes
  • Previous by thread: Double-quotes and Bar-quotes
  • Next by thread: Re: Double-quotes and Bar-quotes
  • Index(es):
    • Date
    • Thread