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: John Delacour <email@hidden>
- Date: Mon, 5 Aug 2002 09:30:30 +0100
At 6:38 pm -1000 4/8/02, Reinhold Penner wrote:
I need help:
set x to "test.cgi\?"
...sure, that returns "test.cgi?", but have you actually read what I
wrote? I need to escape the "?" in order to pass it to the shell. A
literal "?" in a shell command will break the shell command.
I can't see what the problem is. Whether you escape it in the shell
or not makes no difference in this case, but in AS the backslash must
be "\\"
Do this. Three files will be created and opened in TextEdit...
set ls to {"test.cgi?", "test.cgi\\?", "test.cgi\\\\?"}
set vLog to {}
repeat with s in ls
set f to "" & (path to current user folder) & ("" & s)
open for access file f with write permission
write "hello" to file f
close access file f
do shell script "cd ; open -e " & s
set end of vLog to do shell script "echo " & s
end repeat
activate
choose from list vLog with empty selection allowed
JD
_______________________________________________
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.