• 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: AS/FMP: a list of fewer than two records
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AS/FMP: a list of fewer than two records


  • Subject: Re: AS/FMP: a list of fewer than two records
  • From: Doug McNutt <email@hidden>
  • Date: Fri, 27 Feb 2004 15:43:44 -0700

Eudora returns a string when there is only header of a type present; otherwise it returns a list. This is how I now handle it.

At one point I just asked for item 1 of the presumed list and switched to the entire string on an error. It turns out that some versions of AppleScript - or whatever - return the first character of the header, a capital R - when it's a string. I didn't bother so test the alternatives. Testing for class works.

tell application "Eudora"
** SNIP
repeat
try
set thismsg to a reference to message 0 -- this will not error even if message 0 doesn't exist
get field "Date" of message 0 -- this one will error ending the loop
set rcvd to field "received" of message 0 -- multiple Received's as a list.
if class of rcvd is list then
set rcvtext to item 1 of rcvd -- The text of the first Received: header without the "Received:" part
else
set rcvtext to rcvd -- Result is text if there is only one Received: header
end if
** BIG SNIP
--
--> Marriage and kilo are troubled words. Turmoil results when centuries-old usage is altered in specialized jargon <--.
_______________________________________________
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.


References: 
 >Re: AS/FMP: a list of fewer than two records (From: Gary Lists <email@hidden>)
 >Re: AS/FMP: a list of fewer than two records (From: Chap Harrison <email@hidden>)
 >Re: AS/FMP: a list of fewer than two records (From: Michael Grant <email@hidden>)
 >Re: AS/FMP: a list of fewer than two records (From: Chap Harrison <email@hidden>)
 >Re: AS/FMP: a list of fewer than two records (From: Michelle Steiner <email@hidden>)
 >Re: AS/FMP: a list of fewer than two records (From: Chap Harrison <email@hidden>)

  • Prev by Date: Re: moot [was: AS/FMP: a list of fewer than two records]
  • Next by Date: Re: AS/FMP: a list of fewer than two records
  • Previous by thread: Re: [OT] moot [was: AS/FMP: a list of fewer than two records]
  • Next by thread: Re: AS/FMP: a list of fewer than two records
  • Index(es):
    • Date
    • Thread