Re: How do I escape a question mark (?)
Re: How do I escape a question mark (?)
- Subject: Re: How do I escape a question mark (?)
- From: Deivy Petrescu <email@hidden>
- Date: Mon, 05 Aug 2002 19:39:51 -0400
>
I'm not sure what you're talking about, Deivy, because unless I'm
>
missing something, I get the same results for both scripts.
You are not missing anything ... I am!
>
Are you sure you're not being fooled by the result window again?
>
For example, the result of the first script (using "do shell
>
script") appears as this:
I was! The reason is somehow I still separate MacOS and Unix, and
obviously AppleScript is MacOS as opposed to "do shell script" which
is just a way of AS to get to the Unix.
So the result from set a to "\\a" would act as you mentioned, but I
was not really concatenating the result of do shell script with
AppleScript, if this mess makes sense.
It does for me now!
>
>
{{"b", "\\c", "\\d", "\\\\e"}, {"b", "c", "d", "\\e"}}
>
>
However, because this is source form, every backslash appears as
>
two, so the resulting strings are actually...
>
>
b, \c, \d, \\e b, c, d, \e
>
>
...which is correct. When debugging this sort of thing, you may
>
find it helpful to run the script using osascript with no options
>
(or -sh if you're feeling pedantic). That displays the result in
>
"human-readable" form, which doesn't escape backslashes. (It also
>
doesn't display list braces, so it's not useful for some things, but
>
there you are.)
Thanks for clarifying this to me, Chris! However, the AS way would be just
set d to "\\\\\\\\e"
set l4 to do shell script "echo " & d
log d
log l4
-->\\\\e
-->\\\\e
I would never log it, since I did not think it would be different, it
is Unix!!!
I do now!
However, if I can bother you a bit more, why:
do shell script "open eval echo /Web\\ Download/ "
works
and on terminal
"open eval echo /Web\\ Download/ "
does not, with all kinds of quotes I can think of (`,',")
Thanks again!
>
>
--Chris Nebel
>
AppleScript Engineering
>
>
On Monday, August 5, 2002, at 01:49 PM, Deivy Petrescu wrote:
--
Deivy Petrescu
http://www.dicas.com
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.