• 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: can I do this better?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: can I do this better?


  • Subject: Re: can I do this better?
  • From: Jon Pugh <email@hidden>
  • Date: Sat, 15 Jun 2002 09:30:12 -0700

At 7:25 AM -0700 6/15/02, Bill Hoffman wrote:
>set tString to "Here's what i say to that: are you sure this will work in _ALL_ ****ing cases correctly?? "
>
>set TID to AppleScript's text item delimiters
>set AppleScript's text item delimiters to space
>set tString to words 1 thru -1 of tString as string
>set AppleScript's text item delimiters to TID
>tString

OK, I'll give you that. ;)

If you want a list, leave off the "as string". If you want the string as it was, you'll need to set the tids to space so that spaces get put in during the coercion to string. Otherwise it just mashes the words together.

It all depends on what you want, especially since this is a pretty useless example. Now, change the -1 to -2 and it will strip off the last word. Which is, I believe, how we got into this situation in the first place.

Jon
_______________________________________________
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.

  • Follow-Ups:
    • Re: can I do this better?
      • From: Bill Hoffman <email@hidden>
References: 
 >Re: can I do this better? (From: Bill Hoffman <email@hidden>)

  • Prev by Date: Re: Getting this list item
  • Next by Date: Evaluate text to boolean
  • Previous by thread: Re: can I do this better?
  • Next by thread: Re: can I do this better?
  • Index(es):
    • Date
    • Thread