Re: Accessing front window of Mail.app
Re: Accessing front window of Mail.app
- Subject: Re: Accessing front window of Mail.app
- From: Axel Luttgens <email@hidden>
- Date: Sun, 6 Sep 2009 19:16:08 +0200
Le 6 sept. 09 à 18:42, Mike Matthews a écrit :
Hi:
I've been trying to find a way for this AppleScript (or something
like it) to work:
tell application "Mail"
set theContent to the content of the front window
end tell
But it appears that there's no way to target the front window of
Mail, including in the 10.6 version of Mail.
Hello Mike,
It is possible to target Mail's front window:
tell application "Mail"
tell front window
properties
end tell
end tell
But it clearly appears that a window doesn't have a content property.
In fact, looking at Mail's dictionary, a window doesn't allow access
to any of the properties you seem to be interested in.
You need to somehow target a message.
error "Mail got an error: Can’t get content of window 1." number
-1728 from content of window 1
This fails as well:
tell application "Mail"
set theContent to the content of the front message
end tell
error "Mail got an error: Can’t get message 1." number -1728 from
message 1
Anyone have an ideas?
Perhaps could you try with the application's "selection" property?
Something like this:
tell application "Mail"
tell item 1 of (get selection)
properties
end tell
end tell
HTH,
Axel
_______________________________________________
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