Re: Escape character problem
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