• 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
Summary: TID (Text Item Delimiters)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Summary: TID (Text Item Delimiters)


  • Subject: Summary: TID (Text Item Delimiters)
  • From: Robert Poland <email@hidden>
  • Date: Fri, 30 May 2003 11:57:46 -0600

> > Speaking of TIDs, Why doesn't the following remove spaces? and why
>> are the letters items and not words?
>>
>> set readData to " 2 7 -June-2003"
>> my shortenMonth(readData)
>> display dialog ">" & result & "<" as string -- arrows for clarity
>>
>>
>> on shortenMonth(readData) -- set month to first 3 characters
>> set AppleScript's text item delimiters to " " -- set TID to space
>> set AppleScript's text item delimiters to "" -- remove spaces
>> set AppleScript's text item delimiters to "-" -- seperate
>> into three words
>> set theMonth to item 2 of readData
>> display dialog theMonth as string
>> set result to (characters 1 thru 3 of readData)
>> set readData to (result)
>> set AppleScript's text item delimiters to ""
>> return {readData}
>> end shortenMonth

As several people pointed I need to specify TEXT item. I had falsely
assumed that by defining a space as a TID then as a "" all spaces
would be replaced with a "".

Turns out that the following did what I wanted.

set readData to " 2 7 -June-2003"
my shortenMonth(readData)
display dialog ">" & result & "<" as string -- arrows for clarity


on shortenMonth(readData) -- set month to first 3 characters
set AppleScript's text item delimiters to "-" -- seperate
into three words
set readData to (characters 1 thru 3 of text item 2 of readData)
set AppleScript's text item delimiters to ""
return {readData}
end shortenMonth

Thanks,
--
Bob Poland - Englewood, CO
http://www.ibrb.org/
_______________________________________________
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: Summary: TID (Text Item Delimiters)
      • From: Michelle Steiner <email@hidden>
References: 
 >Re: TID (Text Item Delimiters) (From: Andrew Oliver <email@hidden>)

  • Prev by Date: Re: Faster List Checking
  • Next by Date: Re: Summary: TID (Text Item Delimiters)
  • Previous by thread: Re: TID (Text Item Delimiters)
  • Next by thread: Re: Summary: TID (Text Item Delimiters)
  • Index(es):
    • Date
    • Thread