• Apfeltalk ändert einen Teil seiner Allgemeinen Geschäftsbedingungen (AGB), das Löschen von Useraccounts betreffend.
    Näheres könnt Ihr hier nachlesen: AGB-Änderung
  • Seit Gutenbergs Zeiten haben sich nicht nur Bücher über die ganze Welt verbreitet, sondern Buchstaben und Wörter begleiten uns allumfassend. Selbst moderne Devices mit Sprachsteuerung und Super-KI kommen nicht ohne Buchstaben, Wörter oder Symbole aus. Nicht zuletzt darum ist das Thema das Monats Am Anfang war das Wort ---> Klick

[iCal] Besprechungseinladungen per Skript/Regel automatisch annehmen geht nicht mehr

Mittagspause

Boskop
Registriert
16.07.09
Beiträge
206
Hi,
ich hatte zwei Regeln in iCal definiert, die erste Regel scannt eingehende Emails auf .ics Dateianhänge (Kalendereinträge) und führt dann das nachfolgende Skript aus. Dies soll dazu führen, dass diese Besprechungseinladung automatisch dem Kalender hinzugefügt wird.
Eine zweite Regel scannt ebenfalls die Emails und verschiebt in den Papierkorb, wenn ein .ics Dateianhang dabei ist.

Regel 2 funktioniert nach wie vor, Regel 1 seit Mavericks nicht mehr. In den Systemeinstellungen/Sicherheit habe ich angehakt, dass Mail mit Kalender kommunizieren darf.

Könnte mal jemand drüberschauen, ob sich ein Fehler findet ? Ich bin etwas ratlos, da es bisher beide Regeln problemlos funktioniert haben, jetzt klappt nur noch Regel 2. Es werden derzeit die Kalendereinladungen nicht mehr automatisch im Kalender eingetragen (Regel 1). Wenn ich im Papierkorb die Besprechungseinladung (=Email) anschaue, und auf den .ics-Anhang gehe und diesen aufrufe, kann ich die Einladung annehmen, aber nur manuell.

Anbei das Skript:

property theAttachmentPath : (path to desktop) as Unicode text
property add_events : "Importieren" -- The title of the "Add Events" dialog on your system.
property cal_name : "myCalendar" -- The name of the target calendar.

using terms from application "Mail"
on perform mail action with messages theMessages for rule theRule
tell application "Mail"
repeat with This_Message in theMessages
repeat with ma in mail attachments of This_Message
set n to name of ma
if n ends with ".ics" then
save ma in file (theAttachmentPath & n)
my import_to_iCal(theAttachmentPath & n)
end if
end repeat
end repeat
end tell
end perform mail action with messages
end using terms from

on import_to_iCal(file_path)
tell application "iCal"
activate
set c to (count events of calendar cal_name)
ignoring application responses
open file file_path
end ignoring
end tell
tell application "System Events"
tell application process "iCal"
set frontmost to true
tell window add_events
repeat until (it exists)
delay 0.2
end repeat
click pop up button 1
repeat until (menu 1 of pop up button 1 exists)
delay 0.2
end repeat
click menu item cal_name of menu 1 of pop up button 1
repeat while (menu 1 of pop up button 1 exists)
delay 0.2
end repeat
click button "OK"
end tell
end tell
end tell
tell application "iCal"
repeat until ((count events of calendar cal_name) > c)
delay 0.2
end repeat
end tell
tell application "Finder" to delete file file_path
end import_to_iCal


Vielen Dank

M