Re: problem with a mail.app script
Re: problem with a mail.app script
- Subject: Re: problem with a mail.app script
- From: BJ Terry <email@hidden>
- Date: Mon, 12 Apr 2004 11:29:32 -0700
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.