I wanted to write a script to select the first message in the current mailbox.
so i wrote following script
tell application “Mail”
set curBox to item 1 of selected mailboxes
set msgs to messages of curBox
set selected messages to {item 1 of msgs}
end tell
it gave me an error on the second line “Mail got an error: Can’t get selected mailboxes.”
how can i get this to work?