• 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: Handler does not accept space in textstring
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Handler does not accept space in textstring


  • Subject: Re: Handler does not accept space in textstring
  • From: Christopher Stone <email@hidden>
  • Date: Wed, 05 Mar 2014 21:06:51 -0600

On Mar 05, 2014, at 19:32, Christopher Nebel <email@hidden> wrote:
People will sometimes advise replacing space characters in the string with “\ “, or using “quote & act & quote”, etc.  Don’t.  If you try to implement quoting yourself, you *will* get it wrong.  Use “quoted form of” instead.
______________________________________________________________________

Listen to the mighty one and learn.

Quoted Form Of is the simplest method, because it's basically bombproof.

If you don't like writing it all the time then use a handler.

on qf(_text)
return quoted form of _text
end qf

set _text to "Now is the' /time for all\\ good men to come\" to the “aid” of their country."
do shell script "echo " & qf(_text)

--
Best Regards,
Chris


 _______________________________________________
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/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Handler does not accept space in textstring
      • From: Iurista GmbH <email@hidden>
References: 
 >Handler does not accept space in textstring (From: Iurista GmbH <email@hidden>)
 >Re: Handler does not accept space in textstring (From: Christopher Nebel <email@hidden>)

  • Prev by Date: Re: Handler does not accept space in textstring
  • Next by Date: Re: Handler does not accept space in textstring
  • Previous by thread: Re: Handler does not accept space in textstring
  • Next by thread: Re: Handler does not accept space in textstring
  • Index(es):
    • Date
    • Thread