• 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: silly newbie question #42
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: silly newbie question #42


  • Subject: Re: silly newbie question #42
  • From: Paul Berkowitz <email@hidden>
  • Date: Wed, 10 Apr 2002 09:51:34 -0700

On 4/10/02 8:47 AM, "Natalie Lambert" <email@hidden> wrote:

> I'm trying to create a small but helpful script that
> can take the result of input, detect any spaces (as it
> will not always have one and should it, it might not
> be in the same place), remove them, then set the
> result as another string.
>
> ie.
>
> set cityName as "St Louis"
> --find space, remove space
> set result as newCityName
>

set cityName to "St Louis"
set AppleScript's text item delimiters to {" "}
set textItems to text items of cityName
set AppleScript's text item delimiters to {""}
set newCityname to textItems as string

--> "StLouis"


Normally you have to reset the delimiters to {""}, the default (or to
whatever they were before, ify ou prefer) at the end of a script, since they
are application-wide and will maintain themselves in all scrip-t in that
application (e.g. script Editor or whatever is running the script) until
itis quit and relaunched. But here they've already been set to {""} so it's
not necessary. Never leave them as {" "} or anything other than {""} at the
end of a script.

> help?
>
> natalie
> Yahoo! Tax Center - online filing with TurboTax

I really would prefer not to know that.

> http://taxes.yahoo.com/

That too.


--
Paul Berkowitz
_______________________________________________
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: 
 >silly newbie question #42 (From: Natalie Lambert <email@hidden>)

  • Prev by Date: Re: silly newbie question #42
  • Next by Date: Re: Trimming down a list
  • Previous by thread: Re: silly newbie question #42
  • Next by thread: Re: silly newbie question #42
  • Index(es):
    • Date
    • Thread