Mails in Postfach bewegen…

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

This entry was posted in Apple Mail and tagged , , , , , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

2 Comments

  1. Shadow
    Posted December 7, 2009 at 1:41 am | Permalink

    Hi Hubi,

    Ich habe folgende Struktur: AccountName => Archiv => Unterordner.

    Dein Script gibt mir Unterordner zur Auswahl, allerdings lässt es mich Mails nur nach Archiv verschieben. Beim Versuch auf Unterordner zu schieben, bekomme ich die Fehlermeldung:

    Error number: -1728
    Message: Mail got an error: Can’t get mailbox "Unterordner" of account "Account".

    Hast du dafür Abhilfe?

    Grüße

  2. hubi
    Posted December 7, 2009 at 4:22 am | Permalink

    Schau Dir mal die neue Version an... sollte jetzt funktionieren.

One Trackback

  1. By hubionmac.com » Mails ins Postfach bewegen… 2.0 on December 7, 2009 at 4:21 am

    [...] jetzt zwar nicht mehr ganz so simpel und "elegant" wie die erste Version, dafür kommt das Ding nun aber mit existierenden Unterordner und POP-Accounts (bisher nur IMAP) [...]

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

CAPTCHA:


five + 6 =

Subscribe without commenting

  • Seite übersetzen:


    Paypal for Pizza:




  • Kategorien


  • Letzte Kommentare

    • Niklas: Vielen Vielen Dank! So klappt es!
    • hubi: Servus Niklas, ich habe mir den Quellcode noch einmal angesehen und habe nun unter 10.7.3 einen Weg gefunden...
    • Niklas: Klingt super das Script. Leider bekomm ich immer folgende Fehlermeldung: error “„Mail“ hat einen Fehler...
    • Jürgen: Hallo Hubi, beim Abfragen von Kennworten gibt es noch eine böse Falle: Das Format, in dem security antwortet,...
    • hubi: Am einfachsten Du öffnest im AppleScript-Editor mal das Funktionsverzeichnis (unter Ablage) von iTunes. Ein...