• 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: myLoop: getting subject of messages in Mail.app
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: myLoop: getting subject of messages in Mail.app


  • Subject: Re: myLoop: getting subject of messages in Mail.app
  • From: John Delacour <email@hidden>
  • Date: Sat, 1 Mar 2003 01:54:09 +0000
  • Mac-eudora-version: 6.0a8

At 7:01 pm -0600 28/2/03, Phebe Anggreani wrote:

I'm trying to set focused on thread of selected message. But somehow it always returned an error when repeating to get the subject of message x. I have no idea why. I've tried to set them as string and/or create another value before comparing subjects, but it always stopped at getting the subject of first message while looping. Can someone please shed a light? Here's the script:

set deLim to AppleScript's text item delimiters
set AppleScript's text item delimiters to "Re: "

tell application "Mail"
set theSbj to subject of item 1 of (get selection)
set mainSbj to the last text item of theSbj

set selectedMsg to {}
repeat with thisMsg in all messages of front message viewer

(*here's where the problem begins, I can't get the subject of the message*)
if subject of thisMsg contains (mainSbj as string) is true then
set the end of selectedMsg to thisMsg
end if
end repeat

tell application "Mail" to set properties of front message viewer to {focused messages:selectedMsg}
end tell

Run your script in with the event viewer open, then try this one and then ask cricket why.


set my text item delimiters to "Re: "
tell application "Mail"
set vSubject to subject of item 1 of (get selection)
set vSubject to the last text item of vSubject
set my text item delimiters to {""}
set vList to {}
all messages in the front message viewer
repeat with vMessage in result
set vMessage to item 1 of vMessage -- !!
if vSubject is in vMessage's subject then
set end of vList to vMessage
end if
end repeat
set properties of front message viewer to {focused messages:vList}
end tell
return vList
_______________________________________________
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: myLoop: getting subject of messages in Mail.app
      • From: Christopher Nebel <email@hidden>
  • Prev by Date: Re: Suggestions for speeding up code
  • Next by Date: Re: dd: Delay hogs memory
  • Previous by thread: Re: Suggestions for speeding up code
  • Next by thread: Re: myLoop: getting subject of messages in Mail.app
  • Index(es):
    • Date
    • Thread