Re: Getting the location of mailboxes from mail/Eudora
Re: Getting the location of mailboxes from mail/Eudora
- Subject: Re: Getting the location of mailboxes from mail/Eudora
- From: kai <email@hidden>
- Date: Wed, 7 Feb 2007 14:00:41 +0000
On 2 Feb 2007, at 23:14, B&b Software wrote:
Does anyone know if its possible to obtain the file location (path
to) of a specified mailbox (or individual message). For example, what
I'd like to do is ...
tell application "Mail"
set filePath to location of mailbox "Test" as alias
end tell
Does anyone know a way of doing this.
While you've had some responses regarding Eudora, it looks from your
code as if you're also interested in a similar suggestion for Mail -
in which case you might like to try something like the following
handler:
-------------
on alias_file for m
if m's class is «class mbxp» then
set e to "mbox"
else
set e to "mbox/Messages/" & m's id & ".emlx"
set m to m's «class mbxp»
end if
set n to "/" & (m as record)'s «class seld» & "."
tell m's «class mact» to if exists then
set p to its «class path»
if its «class atyp» is not «constant etocetpo» then set n to n &
"imap"
else
tell application "System Events"
set p to value of property list item "AccountPath" of ¬
property list item 1 of property list item "MailAccounts" of ¬
property list file (preferences folder's POSIX path & "/
com.apple.mail.plist")
if p starts with "~" then set p to home folder's POSIX path & p's
text 2 thru -1
end tell
end if
p & n & e as POSIX file as alias
end alias_file
tell application "Mail"
set msg to beginning of (get selection)
set mbx to msg's mailbox
end tell
{alias_file for mbx, alias_file for msg}
-------------
---
kai
_______________________________________________
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/mailman//archives/applescript-users
This email sent to email@hidden