• 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: Bill Hoffman <email@hidden>
  • Date: Sat, 15 Jun 2002 07:25:15 -0700

On Friday, June 14, 2002, at 11:39 PM, Jon Pugh wrote:

At 8:06 PM -0700 6/14/02, Geoff Canyon wrote:
In chunks, the above could be accomplished with:

put word 1 to -1 of tString into tString

I don't remember if HyperCard or SuperCard support negative chunk expressions. If they don't, the expression would be a bit more complicated, but still a single line.

HyperCard does not support negative indices.

Also, the example above produces a list. You probably want to coerce it to a string (although this example leaves tString unchanged):

set tString to word 1 to -1 of tString as string

Presumably you'd want to change 1 or -1 to something more interesting.


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

--
Bill Hoffman
email@hidden
_______________________________________________
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: Jon Pugh <email@hidden>
References: 
 >Re: can I do this better? (From: Jon Pugh <email@hidden>)

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