• 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: How do I escape a question mark (?)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Re: How do I escape a question mark (?) (From: Reinhold Penner <email@hidden>)

  • Prev by Date: Re: Misc Eudora questions
  • Next by Date: Re: How do I escape a question mark (?)
  • Previous by thread: Re: How do I escape a question mark (?)
  • Next by thread: Re: How do I escape a question mark (?)
  • Index(es):
    • Date
    • Thread