You are not logged in.
Hi there,
When I run this:
Applescript:
tell application "Mail"
get some mailbox of first account
end tell
I get the following in Result:
Applescript:
mailbox "INBOX/lists/Scid" of account "Gmail" of application "Mail"
the name of the mailbox is shown as a file path ("INBOX/lists/Scid"), but when I get the name of it:
Applescript:
tell application "Mail"
get name of some mailbox of first account
end tell
I get only the last part ("Scid"), is there a way to get the "full" name?
Thanks!
Israel
Last edited by Raimondi (2009-09-07 11:10:52 am)
Offline
Hi,
either with a forced error and parsing the error text
Applescript:
try
tell application "Mail"
some mailbox as text
end tell
on error e
set {TID, text item delimiters} to {text item delimiters, quote}
set mailboxName to text item 2 of e
set text item delimiters to TID
end try
mailboxName
or collect the path recursively
Applescript:
tell application "Mail"
set theBox to some mailbox
set thePath to name of theBox
repeat
try
set theBox to container of theBox
set thePath to name of theBox & "/" & thePath
on error
exit repeat
end try
end repeat
end tell
thePath
regards
Stefan
Offline
Nice! as I couldn't find a way to get it in one line, I was wondering how to do the recursive loop, your solution is perfect.
Thanks!
Israel
Offline