• 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: Escape character problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Escape character problem


  • Subject: Re: Escape character problem
  • From: Brian Gist <email@hidden>
  • Date: Fri, 18 Mar 2005 00:36:17 -0700

I knew it was late ... coding after midnight = bad.

Thanks to Andrew and Michelle,



On Mar 17, 2005, at 2:34 AM, Brian Gist wrote:

> My sanity thanks you in advance.

Try this:

set nameVar to "  \"Name\" "
display dialog nameVar

--
"To announce that there must be no criticism of the president, or that
we are to stand by the president right or wrong, is not only
unpatriotic and servile, but is morally treasonable to the American
public."     --Teddy Roosevelt

That's exactly what you have.

Don't get confused with AppleScript's _display_ of the string and the string
itself.

If you ask AppleScript to display the string (e.g. via log) it will insert
the backslashes to denote the quote character within the string as opposed
to the normal quote delimiter.

You can verify this by asking for the length of the string:

set nameVar to "\"Name\""
length of nameVar
--> 6 - the characters "N", a", "m", "e" and the two quotes.

Andrew
:)
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: list to a text representation of that list (followup)
  • Next by Date: Mail.app script help needed
  • Previous by thread: Re: Escape character problem
  • Next by thread: display dialog
  • Index(es):
    • Date
    • Thread