• 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 Apostrophes in 'Do Shell Script'
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Escape Apostrophes in 'Do Shell Script'


  • Subject: Re: Escape Apostrophes in 'Do Shell Script'
  • From: Emmanuel <email@hidden>
  • Date: Fri, 7 Nov 2003 07:51:40 +0100

At 10:44 AM -0800 06/11/03, Christopher Nebel wrote:
> perl -e 'print "What'\''s Up?";'
>
>Or, in AppleScript with the extra backslashes:
>
> do shell script "perl -e 'print \"What'\\''s Up?\";'"
>
>It's not clear to me how to solve this problem in a general way.

Smile has a keyboard shortcut (cmd-") ("Make an AppleScript string" menu item) which makes:

perl -e 'print "What'\''s Up?";'

into:

"perl -e 'print \"What'\\''s Up?\";'"

The shortcut just changes \ into \\ and then " into \".

Since you are asking, would it take more than that to provide a new "AppleScript form" property to strings which would do what you say? But maybe I'm missing something.

------------------------
do shell script (AppleScript form of ("perl -e " & quoted form of (blah blah)))
------------------------

Emmanuel
_______________________________________________
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: 
 >Escape Apostrophes in 'Do Shell Script' (From: Jay Young <email@hidden>)
 >Re: Escape Apostrophes in 'Do Shell Script' (From: Emmanuel <email@hidden>)
 >Re: Escape Apostrophes in 'Do Shell Script' (From: Christopher Nebel <email@hidden>)

  • Prev by Date: Re: PDFs
  • Next by Date: Re: applescript-users digest, Vol 3 #2135 - 16 msgs
  • Previous by thread: Re: illustrator-scripting, again ...
  • Next by thread: Re: Escape Apostrophes in 'Do Shell Script'
  • Index(es):
    • Date
    • Thread