• 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: preserving literal text in AppleScripts
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: preserving literal text in AppleScripts


  • Subject: Re: preserving literal text in AppleScripts
  • From: Emmanuel <email@hidden>
  • Date: Sat, 16 Dec 2006 11:47:53 +0100

At 5:41 PM -0500 12/15/06, Cameron Hayne wrote:
I don't want to have to manually insert backslashes in this code where needed to preserve it from interpretation by AppleScript.

If you don't want to manually insert backslashes, why wouldn't you insert them automatically? You would use a scripting language, for instance AppleScript, why not (our programs work that way thousands of times a day.)


FYI, escaping an AS string is one instruction (uses Satimage.osax, but I'm sure plenty users can propose versions slightly longer which don't):

set s to "\"" & (change {"\\", "\""} into {"\\\\", "\\\""} in s) & "\""

Emmanuel
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/mailman//archives/applescript-users

This email sent to email@hidden
  • Follow-Ups:
    • Re: preserving literal text in AppleScripts
      • From: Cameron Hayne <email@hidden>
References: 
 >preserving literal text in AppleScripts (From: Cameron Hayne <email@hidden>)

  • Prev by Date: Re: preserving literal text in AppleScripts
  • Next by Date: Re: Send selected messages as attachments in Mail.app
  • Previous by thread: Re: preserving literal text in AppleScripts
  • Next by thread: Re: preserving literal text in AppleScripts
  • Index(es):
    • Date
    • Thread