Re: problem with a mail.app script
Re: problem with a mail.app script
- Subject: Re: problem with a mail.app script
- From: Kim Holburn <email@hidden>
- Date: Tue, 13 Apr 2004 09:19:58 +1000
Thanks.
I'm having a bit of trouble understanding the third line of your
fragment. Is this what you meant?
tell application "Mail"
set messageViewers to every message viewer where it's visible is true
set selectedMailboxes to selected mailboxes of messageViewers
^^^^^^^^^^^^^^
Also why are do you need 2 nested repeats? Is selectedMailboxes a list
of lists?
Also is "name of mailbox x" enough to uniquely identify a mailbox?
On 2004 Apr 13, , at 4:29 AM, BJ Terry wrote:
I'm not sure where it's failing, since the relationships all seem to
be correct. The variable mb is specified with "item 1 of selected
mailboxes of item 1 of every message viewer of application "Mail"" and
for some reason, mail.app refuses to resolve the reference correctly.
If you do it more explicitly, it works fine, as in:
tell application "Mail"
set messageViewers to every message viewer where it's visible is true
set selectedMailboxes to selected mailboxes of every message viewer
repeat with currentMessageViewMailboxes in selectedMailboxes
repeat with currentMailbox in currentMessageViewMailboxes
if name of currentMailbox is name of mailbox "Mailing
Lists/AppleScript-users" then
set madeWindow to 1
exit repeat
end if
end repeat
if madeWindow is 1 then
exit repeat
end if
end repeat
return madeWindow
end tell
Basically, mail.app is broken when it comes to resolving references
correctly, so you have to use intermediate variables.
BJ Terry
On Apr 12, 2004, at 8:04 AM, Kim Holburn wrote:
repeat with mv in message viewers
if visible of mv then
repeat with mb in selected mailboxes of mv
set nmb to ""
try
set nmb to name of mb
end try
set dt to "nmb:(" & nmb & ") nmbox:(" & theMboxName & ")"
display dialog dt
if mb is equal to mbox then
set madeWindow to 1
exit repeat
end if
end repeat
if madeWindow = 1 then
exit repeat
end if
end if
end repeat
_______________________________________________
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.
--
Kim Holburn
IT Manager, Canberra Research Laboratory
National Information and Communication Technology Australia
Ph: +61 2 61258620 M: +61 0417820641
Email: email@hidden - PGP Public Key on request
Life is complex - It has real and imaginary parts.
Andrea Leistra (rec.arts.sf.written.Robert-jordan)
_______________________________________________
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.