• 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 to convert *space* to
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to convert *space* to


  • Subject: Re: how to convert *space* to
  • From: Wayne Melrose <email@hidden>
  • Date: Mon, 16 Nov 2009 18:16:25 +0100

On 16. nov. 2009, at 17.46, email@hidden wrote:

>> ... how do i convert a space to  ?
>
> set tString to "Hello Alice"
>
> set {oAStid, AppleScript's text item delimiters} to {AppleScript's text item delimiters, " "}
> set tString to text items of tString
> set AppleScript's text item delimiters to " "
> set tString to tString as string
> set AppleScript's text item delimiters to oAStid
>
> tString


Using this method to replace characters and strings is great, although the fact that the user is specifically asking about "space" to " " indicates that they actually want to encode strings to URL's, in which case the original response, which pointed the user to apple's own example of encoding strings for URL's is alot more appropriate.


 _______________________________________________
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

References: 
 >how to convert *space* to (From: CJ Kelley <email@hidden>)
 >Re: how to convert *space* to (From: email@hidden)

  • Prev by Date: Re: Using long lists in a script
  • Next by Date: Can'tGetMailBox
  • Previous by thread: Re: how to convert *space* to
  • Next by thread: Re: how to convert *space* to
  • Index(es):
    • Date
    • Thread