• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Mail navigation script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mail navigation script


  • Subject: Re: Mail navigation script
  • From: Brian Christmas <email@hidden>
  • Date: Fri, 02 Nov 2012 23:42:10 +1100


On 02/11/2012, at 6:21 PM, Dave C <email@hidden> wrote:

Hello,
I am trying to develop (well, actually modify) a script to provide navigation in an Apple Mail mailbox. 

When a message window is open, Mail does not provide a means to move to the next message without doing this little dance:

1. close message window
2. press arrow key to navigate to next message
3. press Return

These have been combined into a script (below), but it navigates to the next unread message. I want to navigate to the next message, regardless read OR unread.

Any help getting me pointed in the right direction will be gratefully appreciated.

Thanks,
Dave

 G'day Dave

I just knocked this together. I don't know if it's along the lines of what you want. It doesn't like threaded messages unless the thread is expanded.

Regards

Santa

property x : {}

tell application "Mail"
activate
set x to {}
repeat with y in mailboxes of mailbox "Brians stuff"
repeat with yy in messages of y
set end of x to yy
end repeat
end repeat
my MainLoop(1)
end tell

on MainLoop(xx)
tell application "Mail"
activate
repeat
set xxx to (item xx of x)
set selected mailboxes of message viewers to mailbox of xxx
set selected messages of message viewers to xxx
--set temp to the selected messages as list
--open xxx
display dialog "Backwards or Forwards" buttons {"Backwards", "Select this one", "Forwards"}
set b to button returned of the result
if b = "Select this one" then exit repeat
if b = "Backwards" then
set xx to xx - 1
if xx < 1 then set xx to count of x
end if
if b = "Forwards" then
set xx to xx + 1
if xx > (count of x) then set xx to 1
end if
end repeat
end tell
my WaitLoop(xx)
end MainLoop


on WaitLoop(xx)
tell application "Finder"
activate
display dialog "Resume, or Cancel" buttons {"Resume", "Cancel"}
set b to button returned of the result
if b = "Resume" then my MainLoop(xx)
end tell
end WaitLoop
 _______________________________________________
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/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Mail navigation script
      • From: Brian Christmas <email@hidden>
References: 
 >Mail navigation script (From: Dave C <email@hidden>)

  • Prev by Date: Re: wrong result when trying to get Selection from finder window
  • Next by Date: Re: wrong result when trying to get Selection from finder window
  • Previous by thread: Re: Mail navigation script
  • Next by thread: Re: Mail navigation script
  • Index(es):
    • Date
    • Thread