• 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: what the heck - text manipulation script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: what the heck - text manipulation script


  • Subject: Re: what the heck - text manipulation script
  • From: Bill Briggs <email@hidden>
  • Date: Tue, 18 Jul 2006 13:57:31 -0300

Title: Re: what the heck - text manipulation script
At 9:40 AM -0700 7/18/06, Natalie Lambert wrote:
It is supposed to be a tab between "05" and "@St.
Louis" but that isn't really the problem. Even if I do
this....
set AppleScript's text item delimiters to ""
set x to "OCT 05    @St. Louis" as text
set v to text item 2 of x
set y to word 4 of x
return {v, y}
my result is {"C", "St"}

why isn't the script seeing the @ and period as the
part of the word with "St"? Even if I change my
delimiters to a tab or a space the script ignores the
period and see the @ as seperate even though there are
no spaces between. I have told the script "as Text"....

 Well, if you've got tabs in there (that came through as four spaces in the mail message), you can do this.

set oldTID to AppleScript's text item delimiters
try
    
set AppleScript's text item delimiters to {"    "} -- delimiter is a tab
       
       
set x to "OCT 05        @St. Louis" as text
    
set tempList to text items of x
set AppleScript's text item delimiters to {" "}  -- delimiter is a space
       
set y to tempList as text
      
set wordList to text items of y
set w to word 3 of y
   
set t to text item 3 of y
      
set AppleScript's text item delimiters to oldTID
on error
       
set AppleScript's text item delimiters to oldTID
end try
return {wordList, w, t}
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: what the heck - text manipulation script (From: Natalie Lambert <email@hidden>)

  • Prev by Date: Subject: Wdth and depth of current screen resolution
  • Next by Date: Rép : what the heck - text manipulation script
  • Previous by thread: Re: what the heck - text manipulation script
  • Next by thread: Re: what the heck - text manipulation script
  • Index(es):
    • Date
    • Thread