• 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: Parsing out words in email subject
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Parsing out words in email subject


  • Subject: Re: Parsing out words in email subject
  • From: Thomas Fischer <email@hidden>
  • Date: Fri, 29 Jan 2010 00:49:54 +0100

Hi Alex,

Am 29.01.2010 um 00:25 schrieb Alex Zavatone:

> It all depends on you knowing what the text delimiters are set to before you try this.

Sorry, yes, you are right.
Actually, you need

set text item delimiters to space

to make the "as text" in

set allButFirst to words 2 thru -1 of theSubject as text

work right.

In addition, it depends on the way words are defined:
"A continuous series of characters, with word elements parsed according to the word-break rules set in the International preference pane."
And I don't know how these are set: there is no "International preference pane" in my German Snow Leopard, only "Language & Text". And here the word boundaries are set to "Standard", whatever that means...
So I agree that

set allButFirst to text items 2 thru -1 of theSubject as text

is safer.

Thomas

> On Jan 28, 2010, at 5:23 PM, Thomas Fischer wrote:
>
>> Yes, but
>>
>> set theSubject to "Re: Parsing out words in email subject"
>> set theWord to first word of theSubject
>> set allButFirst to words 2 thru -1 of theSubject as text
>> display dialog allButFirst
>>
>> will also give you the correct result.
>> It seems that words work here a little like text items with text item delimiters set to space.
>> But there are some additional subtleties (try quotes), and the AppleScript Language Guide says:
>> "Because the rules for parsing words are thus under user control, your scripts should not count on a deterministic text parsing of words."
>>
>> Cheers
>> Thomas
>

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Parsing out words in email subject
      • From: Shane Stanley <email@hidden>
References: 
 >Re: Parsing out words in email subject (From: "Stockly, Ed" <email@hidden>)
 >Re: Parsing out words in email subject (From: Thomas Fischer <email@hidden>)
 >Re: Parsing out words in email subject (From: Alex Zavatone <email@hidden>)

  • Prev by Date: Re: Unable to open Word Mac documents in Hidden state
  • Next by Date: Re: Parsing out words in email subject
  • Previous by thread: Re: Parsing out words in email subject
  • Next by thread: Re: Parsing out words in email subject
  • Index(es):
    • Date
    • Thread