• 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: Mail and AppleScript frustration (newbie)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mail and AppleScript frustration (newbie)


  • Subject: Re: Mail and AppleScript frustration (newbie)
  • From: Aurélien Hugelé <email@hidden>
  • Date: Fri, 11 Jan 2008 13:38:57 +0100

Thanks it works as desired :)
I just fear that "the first message whose id is ..." means that AppleScript has to go through *all* the messages and test the id (0 n complexity)... And I'm working with hundreds of thousands messages...


Anyway, thanks for the code, Applescript users list seems very responsive :)


Aurélien, Objective Decision Team




On 11 janv. 08, at 13:24, EU - Luca Pozzato wrote:

hello Aurélien,
try the following

tell application "Mail"
set theMessage_ID to id of message 1 of mailbox "INBOX" of account "Support OD"
end tell
--return theMessage_ID


tell application "Mail"
	tell mailbox "INBOX" of account "Support  OD"
		set theMessage to first message whose id is theMessage_ID
	end tell
	set g to content of theMessage
end tell

ciao

Luca



-----Original Message-----
Hi list!

I'm new to AppleScript, but I feel it can be very powerful to
integrate my app with Apple iApps.
I have encountered a lot a frustration lately with Mail.app scripting.
What I want to achieve is very basic, but I can't find a way to solve
the problem.


I would like to access some specific messages in Mail.app.
I've looked at tons of example and suceeded to access *selected*
messages, but not to a specific message by its "id"

Look at this code:

tell application "Mail"
	set theMessage to message 1 of mailbox "INBOX" of account "Support
OD" of application "Mail"
end tell

returns me (in Script Editor):

message id 399989 of mailbox "INBOX" of account "Support OD" of
application "Mail"

now suppose i've stored somewhere the *REAL* id of the message
(399989) somewhere (in fact my cocoa app uses spotlight to get the
message and store this real id in a database), I can't get the
corresponding message back (by id) using AppleScript!!!
why

tell application "Mail"
	set theMessage to message 399989 of mailbox "INBOX" of account
"Support OD" of application "Mail"
end tell

or

tell application "Mail"
	set theMessage to message 399989
end tell

does not work ?

There seems to be something in AppleScript or Mail that convert ids!?

Basically, I want to get messages using their *real* ids, the ids that
are returned by Mail.
Anyone know how can I achieve that?


Thanks for helping a beginner :)



Aurélien,
Objective Decision Team





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


This email sent to email@hidden

_______________________________________________ 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
References: 
 >Mail and AppleScript frustration (newbie) (From: Aurélien Hugelé <email@hidden>)
 >Re: Mail and AppleScript frustration (newbie) (From: "EU - Luca Pozzato" <email@hidden>)

  • Prev by Date: Re: Mail and AppleScript frustration (newbie)
  • Next by Date: Re: How do you update a tracks info in Itunes with applescript
  • Previous by thread: Re: Mail and AppleScript frustration (newbie)
  • Next by thread: Re: Mail and AppleScript frustration (newbie)
  • Index(es):
    • Date
    • Thread