Mails in Postfach bewegen…

16/06/2009
Ist recht praktisch, wenn man es auf einen Shortcut legt. Dann kann man in Apple Mail ausgewählte Nachrichten innerhalb eines Accounts über die Tastatur verschieben =)
Code zum markieren einmal anklicken

-- MoveMailTo

--  Created by Hubi on 16.06.2009

--  Copyright 2009 hubionmac.com. All rights reserved. ;-)


tell application "Mail"

set theSelection to selection

if theSelection ≠ {} then

set ac_name to (name of account of mailbox of (item 1 of theSelection))

set my_mailboxes to {"•••NEW•••"} & (name of every mailbox of account ac_name)

set theaction to choose from list my_mailboxes default items {item 1 of my_mailboxes}

if theaction as text ≠ "false" then

if theaction as text = (item 1 of my_mailboxes) as text then

set new_mailboxname to text returned of (display dialog "New Mailbox" default answer "---New Mailbox ---")

if new_mailboxname as text ≠ "false" then

tell account ac_name to set desti_box to (make new mailbox with properties {name:new_mailboxname})

end if

else

set desti_box to mailbox (theaction as text) of account ac_name

end if

move theSelection to desti_box

end if

else

display dialog "Nix ausgewählt zum verschieben" giving up after 1

end if

end tell

3 Comments