Einladungen in "Kalender" automatisch annehmen

K

KiAr

Aktives Mitglied
Thread Starter
Dabei seit
06.02.2007
Beiträge
173
Reaktionspunkte
2
Hallo Forum,
ich habe folgende Bitte an euch bzw. folgende Frage:
Gibt es eine Möglichkeit (bpsw. per AppleScript) Einladungen in "Kalender" automatisch anzunehmen?

Folgender Grund:
Ich habe einen Outlook Kalender auf Arbeit, hätte meine Termine aber auch gern auf meinem privaten Rechner. Aus diesem Grund habe ich in Outlook ein Makro erstellt, dass wenn ich einen Kalendereintrag erstelle, automatisch eine Mail mit einer .ics Datei an meine private Mail Adresse geschickt wird. Nun habe ich schon google bemüht aber leider keine Ahnung von AppleScript...ich habe allerdings schon folgendes geschafft:
--> Mail kommt an --> .ics Datei wird gespeichert --> Termin als Besprechungseinladung im Kalender eingetragen --> Mail wird gelöscht --> ...an dieser Stelle kommt jetzt der Punkt an dem ich nicht weiterkomme, das die Einladung automatisch angenommen wird.

Folgendes Script habe ich im Netz gefunden und konnte es soweit anpassen:

Code:
using terms from application "Mail"
	on perform mail action with messages theMessages for rule theRule
		repeat with This_Message in theMessages
			tell application "Mail"
				repeat with ma in mail attachments of This_Message
					save ma in ("/Users/username/Downloads/mailattachment.ics")
					tell application "Finder" to open ("/Users/username/Downloads/mailattachment.ics") as POSIX file							
				end repeat
			end tell
		end repeat
	end perform mail action with messages
end using terms from

Weiterhin habe ich noch folgendes gefunden, kann damit aber nichts anfangen, bzw. funktioniert es bei mir nicht...kann mir da vielleicht einer sagen in wie weit ich hier was anpassen muss/kann:

Code:
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

Also, ich wäre euch super dankbar, wenn mir jemand weiterhelfen kann durch:
a.) Erweiterung des ersten Codes
b.) Erklärung des zweiten, bzw. was ich dem verändern muss damit es klappen könnte
c.) jede alternative Lösung die mir helfen könnte

Vielen Dank im Voraus,
Kiar
 
Hallo,

ich habe das 2. Skript mal so angepasst, dass es unter Yosemite laufen sollte:

Code:
[B]property [/B][COLOR=#4F8F00][FONT=Verdana]theAttachmentPath[/FONT][/COLOR][FONT=Verdana] : ([/FONT][COLOR=#012FBE][FONT=Verdana][B]path to [/B][/FONT][/COLOR][COLOR=#5730BE][FONT=Verdana][I]desktop[/I][/FONT][/COLOR][FONT=Verdana]) [/FONT][B]as [/B][COLOR=#0433FF][FONT=Verdana][I]Unicode text
[/I][/FONT][/COLOR][COLOR=#5E6161][FONT=Verdana][COLOR=#000000][B]property[/B] [/COLOR][COLOR=#4f8f00]add_events[/COLOR][COLOR=#000000] : "Ereignis hinzufügen" [/COLOR]-- The title of the "Add Events" dialog on your system.[/FONT][/COLOR]
[COLOR=#5E6161][FONT=Verdana][COLOR=#000000][B]property[/B] [/COLOR][COLOR=#4f8f00]cal_name[/COLOR][COLOR=#000000] : "myCalendar" [/COLOR]-- The name of the target calendar.[/FONT][/COLOR]
[FONT=Verdana]
[/FONT]
[FONT=Verdana][B]using terms from[/B] [COLOR=#0433ff][I]application[/I][/COLOR] "Mail"[/FONT]
[COLOR=#0433FF][FONT=Verdana][COLOR=#000000]    [B]on[/B] [/COLOR][B]perform mail action with messages [/B][COLOR=#4f8f00]theMessages [/COLOR]for rule [COLOR=#4f8f00]theRule[/COLOR][/FONT][/COLOR]
[FONT=Verdana]        [B]tell[/B] [COLOR=#0433ff][I]application[/I][/COLOR] "Mail"[/FONT]
[COLOR=#4F8F00][FONT=Verdana][COLOR=#000000]            [B]repeat[/B] [B]with[/B] [/COLOR]This_Message[COLOR=#000000] [B]in[/B] [/COLOR]theMessages[/FONT][/COLOR]
[FONT=Verdana]                [B]repeat[/B] [B]with[/B] [COLOR=#4f8f00]ma[/COLOR] [B]in[/B] [COLOR=#0433ff][I]mail attachments[/I][/COLOR] [B]of[/B] [COLOR=#4f8f00]This_Message[/COLOR][/FONT]
[FONT=Verdana]                    [B]set[/B] [COLOR=#4f8f00]n[/COLOR] [B]to[/B] [COLOR=#812fdc]name[/COLOR] [B]of[/B] [COLOR=#4f8f00]ma[/COLOR][/FONT]
[FONT=Verdana]                    [B]if[/B] [COLOR=#4f8f00]n[/COLOR] [B]ends with[/B] ".ics" [B]then[/B][/FONT]
[COLOR=#4F8F00][FONT=Verdana][COLOR=#000000]                        [/COLOR][COLOR=#0433ff][B]save [/B][/COLOR]ma [COLOR=#0433ff]in [/COLOR][COLOR=#0433ff][I]file[/I][/COLOR][COLOR=#000000] ([/COLOR]theAttachmentPath[COLOR=#000000] & [/COLOR]n[COLOR=#000000])[/COLOR][/FONT][/COLOR]
[COLOR=#4F8F00][FONT=Verdana][COLOR=#000000]                        [B]my[/B] [/COLOR]import_to_iCal[COLOR=#000000]([/COLOR]theAttachmentPath[COLOR=#000000] & [/COLOR]n[COLOR=#000000])[/COLOR][/FONT][/COLOR]
[FONT=Verdana]                    [B]end[/B] [B]if[/B][/FONT]
[FONT=Verdana]                [B]end[/B] [B]repeat[/B][/FONT]
[FONT=Verdana]            [B]end[/B] [B]repeat[/B][/FONT]
[FONT=Verdana]        [B]end[/B] [B]tell[/B][/FONT]
[COLOR=#0433FF][FONT=Verdana][COLOR=#000000]    [B]end[/B] [/COLOR][B]perform mail action with messages[/B][/FONT][/COLOR]
[FONT=Verdana][B]end[/B] [B]using terms from[/B][/FONT]
[FONT=Verdana]
[/FONT]
[COLOR=#4F8F00][FONT=Verdana][COLOR=#000000][B]on[/B] [/COLOR]import_to_iCal[COLOR=#000000]([/COLOR]file_path[COLOR=#000000])[/COLOR][/FONT][/COLOR]
[FONT=Verdana]    [B]set[/B] [COLOR=#4f8f00]pos_path[/COLOR] [B]to[/B] ([COLOR=#812fdc]POSIX path[/COLOR] [B]of[/B] ([COLOR=#4f8f00]file_path[/COLOR] [B]as[/B] [COLOR=#0433ff][I]alias[/I][/COLOR]))[/FONT]
[FONT=Verdana]    [B]tell[/B] [COLOR=#0433ff][I]application[/I][/COLOR] "Calendar"[/FONT]
[COLOR=#0433FF][FONT=Verdana][COLOR=#000000]        [/COLOR][B]activate[/B][/FONT][/COLOR]
[COLOR=#0433FF][FONT=Verdana][COLOR=#000000]        [B]set[/B] [/COLOR][COLOR=#4f8f00]c[/COLOR][COLOR=#000000] [B]to[/B] ([/COLOR][B]count [/B][I]events[/I][COLOR=#000000] [B]of[/B] [/COLOR][I]calendar [/I][COLOR=#4f8f00]cal_name[/COLOR][COLOR=#000000])[/COLOR][/FONT][/COLOR]
[FONT=Verdana]    [B]end[/B] [B]tell[/B][/FONT]
[FONT=Verdana]    [/FONT]
[FONT=Verdana]    [B]tell[/B] [COLOR=#0433ff][I]application[/I][/COLOR] "System Events"[/FONT]
[COLOR=#0433FF][FONT=Verdana][COLOR=#000000]        [B]tell[/B] [/COLOR][I]application process[/I][COLOR=#000000] "Calendar"[/COLOR][/FONT][/COLOR]
[COLOR=#812FDC][FONT=Verdana][COLOR=#000000]            [B]set[/B] [/COLOR]frontmost[COLOR=#000000] [B]to[/B] [/COLOR][I]true[/I][/FONT][/COLOR]
[COLOR=#0433FF][FONT=Verdana][COLOR=#000000]            [/COLOR][B]click[/B][COLOR=#000000] [B]of[/B] [/COLOR][I]menu item[/I][COLOR=#000000] 6 [B]of[/B] [/COLOR][I]menu[/I][COLOR=#000000] 1 [B]of[/B] [/COLOR][I]menu bar item[/I][COLOR=#000000] 3 [B]of[/B] [/COLOR][I]menu bar[/I][COLOR=#000000] 1[/COLOR][/FONT][/COLOR]
[FONT=Verdana]            [B]tell[/B] [COLOR=#0433ff][I]window[/I][/COLOR] "Kalender: Importieren"[/FONT]
[FONT=Verdana]                [B]repeat[/B] [B]until[/B] [B]it[/B] [COLOR=#0433ff][B]exists[/B][/COLOR][/FONT]
[FONT=Verdana]                    [COLOR=#0433ff][B]delay[/B][/COLOR] 0.2[/FONT]
[FONT=Verdana]                [B]end[/B] [B]repeat[/B][/FONT]
[FONT=Verdana]                [COLOR=#0433ff][B]delay[/B][/COLOR] 0.1[/FONT]
[COLOR=#812FDC][FONT=Verdana][COLOR=#000000]                [/COLOR][COLOR=#0433ff][B]keystroke[/B][/COLOR][COLOR=#000000] "g" [/COLOR][COLOR=#0433ff]using[/COLOR][COLOR=#000000] {[/COLOR][I]command down[/I][COLOR=#000000], [/COLOR][I]shift down[/I][COLOR=#000000]}[/COLOR][/FONT][/COLOR]
[FONT=Verdana]                [COLOR=#0433ff][B]delay[/B][/COLOR] 0.5[/FONT]
[COLOR=#0433FF][FONT=Verdana][COLOR=#000000]                [/COLOR][B]keystroke [/B][COLOR=#4f8f00]pos_path[/COLOR][/FONT][/COLOR]
[COLOR=#0433FF][FONT=Verdana][COLOR=#000000]                [/COLOR][B]keystroke [/B][COLOR=#812fdc]return[/COLOR][/FONT][/COLOR]
[COLOR=#0433FF][FONT=Verdana][COLOR=#000000]                [/COLOR][B]keystroke [/B][COLOR=#812fdc]return[/COLOR][/FONT][/COLOR]
[FONT=Verdana]            [B]end[/B] [B]tell[/B][/FONT]
[COLOR=#4F8F00][FONT=Verdana][COLOR=#000000]            [B]tell[/B] [/COLOR][COLOR=#0433ff][I]window [/I][/COLOR]add_events[/FONT][/COLOR]
[FONT=Verdana]                [B]repeat[/B] [B]until[/B] ([B]it[/B] [COLOR=#0433ff][B]exists[/B][/COLOR])[/FONT]
[FONT=Verdana]                    [COLOR=#0433ff][B]delay[/B][/COLOR] 0.2[/FONT]
[FONT=Verdana]                [B]end[/B] [B]repeat[/B][/FONT]
[COLOR=#0433FF][FONT=Verdana][COLOR=#000000]                [/COLOR][B]click [/B][I]pop up button[/I][COLOR=#000000] 1[/COLOR][/FONT][/COLOR]
[FONT=Verdana]                [B]repeat[/B] [B]until[/B] ([COLOR=#0433ff][I]menu[/I][/COLOR] 1 [B]of[/B] [COLOR=#0433ff][I]pop up button[/I][/COLOR] 1 [COLOR=#0433ff][B]exists[/B][/COLOR])[/FONT]
[FONT=Verdana]                    [COLOR=#0433ff][B]delay[/B][/COLOR] 0.2[/FONT]
[FONT=Verdana]                [B]end[/B] [B]repeat[/B][/FONT]
[COLOR=#0433FF][FONT=Verdana][COLOR=#000000]                [/COLOR][B]click [/B][I]menu item [/I][COLOR=#4f8f00]cal_name[/COLOR][COLOR=#000000] [B]of[/B] [/COLOR][I]menu[/I][COLOR=#000000] 1 [B]of[/B] [/COLOR][I]pop up button[/I][COLOR=#000000] 1[/COLOR][/FONT][/COLOR]
[FONT=Verdana]                [B]repeat[/B] [B]while[/B] ([COLOR=#0433ff][I]menu[/I][/COLOR] 1 [B]of[/B] [COLOR=#0433ff][I]pop up button[/I][/COLOR] 1 [COLOR=#0433ff][B]exists[/B][/COLOR])[/FONT]
[FONT=Verdana]                    [COLOR=#0433ff][B]delay[/B][/COLOR] 0.2[/FONT]
[FONT=Verdana]                [B]end[/B] [B]repeat[/B][/FONT]
[COLOR=#0433FF][FONT=Verdana][COLOR=#000000]                [/COLOR][B]click [/B][I]button[/I][COLOR=#000000] "OK"[/COLOR][/FONT][/COLOR]
[FONT=Verdana]            [B]end[/B] [B]tell[/B][/FONT]
[FONT=Verdana]        [B]end[/B] [B]tell[/B][/FONT]
[FONT=Verdana]    [B]end[/B] [B]tell[/B][/FONT]
[FONT=Verdana]    [B]tell[/B] [COLOR=#0433ff][I]application[/I][/COLOR] "Calendar"[/FONT]
[FONT=Verdana]        [B]repeat[/B] [B]until[/B] (([COLOR=#0433ff][B]count[/B][/COLOR] [COLOR=#0433ff][I]events[/I][/COLOR] [B]of[/B] [COLOR=#0433ff][I]calendar[/I][/COLOR] [COLOR=#4f8f00]cal_name[/COLOR]) > [COLOR=#4f8f00]c[/COLOR])[/FONT]
[FONT=Verdana]            [COLOR=#0433ff][B]delay[/B][/COLOR] 0.2[/FONT]
[FONT=Verdana]        [B]end[/B] [B]repeat[/B][/FONT]
[FONT=Verdana]    [B]end[/B] [B]tell[/B][/FONT]
[FONT=Verdana]    [B]tell[/B] [COLOR=#0433ff][I]application[/I][/COLOR] "Finder" [B]to[/B] [COLOR=#0433ff][B]delete[/B][/COLOR] [COLOR=#0433ff][I]file[/I][/COLOR] [COLOR=#4f8f00]file_path[/COLOR][/FONT]
[COLOR=#000000][FONT=Verdana][B]end[/B] [/FONT][/COLOR][COLOR=#4F8F00][FONT=Verdana]import_to_iCal[/FONT][/COLOR]

Eventuell müssen die delay-Werte noch etwas angepasst werden. Der Name deines Kalenders in der 3. Zeile muss logischerweise ebenfalls angepasst werden.
 
Hey Pill,
zunächst einmal vielen Dank für deine Mühe.
Ich arbeite noch mit Mavericks und leider funktioniert das ganze bei mir nicht. Er speichert die *.ics Datei auf dem Desktop, danach ist Schluss. Also er importiert noch nicht mal in den Kalender. Liegt es an Mavericks oder ist im Skript noch etwas falsch?

Viele Grüße
Kiar
 
Füge mal bitte dieses Skript in den AppleScript-Editor ein, führe es aus und schau mal, welche Fehlermeldung kommt:

Code:
[COLOR=#000000][FONT=Verdana][B]property[/B] [/FONT][/COLOR][COLOR=#4F8F00][FONT=Verdana]add_events[/FONT][/COLOR][COLOR=#000000][FONT=Verdana] : "Ereignis hinzufügen" [/FONT][/COLOR][COLOR=#5E6161][FONT=Verdana]-- The title of the "Add Events" dialog on your system.
[/FONT][/COLOR][COLOR=#5E6161][FONT=Verdana][COLOR=#000000][B]property[/B] [/COLOR][COLOR=#4f8f00]cal_name[/COLOR][COLOR=#000000] : "Privat" [/COLOR]-- The name of the target calendar.[/FONT][/COLOR]
[FONT=Verdana]
[/FONT]
[FONT=Verdana][B]set[/B] [COLOR=#4f8f00]file_path[/COLOR] [B]to[/B] ([COLOR=#012fbe][B]choose file[/B][/COLOR] [COLOR=#012fbe]with prompt[/COLOR] "Wählen Sie die ICS-Datei aus:")[/FONT]
[COLOR=#4F8F00][FONT=Verdana][COLOR=#000000][B]set[/B] [/COLOR]pos_path[COLOR=#000000] [B]to[/B] [/COLOR][COLOR=#812fdc]POSIX path[/COLOR][COLOR=#000000] [B]of[/B] [/COLOR]file_path[/FONT][/COLOR]
[FONT=Verdana][B]tell[/B] [COLOR=#0433ff][I]application[/I][/COLOR] "Calendar"[/FONT]
[COLOR=#0433FF][FONT=Verdana][COLOR=#000000]    [/COLOR][B]activate[/B][/FONT][/COLOR]
[COLOR=#0433FF][FONT=Verdana][COLOR=#000000]    [B]set[/B] [/COLOR][COLOR=#4f8f00]c[/COLOR][COLOR=#000000] [B]to[/B] ([/COLOR][B]count [/B][I]events[/I][COLOR=#000000] [B]of[/B] [/COLOR][I]calendar [/I][COLOR=#4f8f00]cal_name[/COLOR][COLOR=#000000])[/COLOR][/FONT][/COLOR]
[FONT=Verdana][B]end[/B] [B]tell[/B][/FONT]
[FONT=Verdana]
[/FONT]
[FONT=Verdana][B]tell[/B] [COLOR=#0433ff][I]application[/I][/COLOR] "System Events"[/FONT]
[COLOR=#0433FF][FONT=Verdana][COLOR=#000000]    [B]tell[/B] [/COLOR][I]application process[/I][COLOR=#000000] "Calendar"[/COLOR][/FONT][/COLOR]
[COLOR=#812FDC][FONT=Verdana][COLOR=#000000]        [B]set[/B] [/COLOR]frontmost[COLOR=#000000] [B]to[/B] [/COLOR][I]true[/I][/FONT][/COLOR]
[COLOR=#0433FF][FONT=Verdana][COLOR=#000000]        [/COLOR][B]click[/B][COLOR=#000000] [B]of[/B] [/COLOR][I]menu item[/I][COLOR=#000000] 6 [B]of[/B] [/COLOR][I]menu[/I][COLOR=#000000] 1 [B]of[/B] [/COLOR][I]menu bar item[/I][COLOR=#000000] 3 [B]of[/B] [/COLOR][I]menu bar[/I][COLOR=#000000] 1[/COLOR][/FONT][/COLOR]
[FONT=Verdana]        [B]tell[/B] [COLOR=#0433ff][I]window[/I][/COLOR] "Kalender: Importieren"[/FONT]
[FONT=Verdana]            [B]repeat[/B] [B]until[/B] [B]it[/B] [COLOR=#0433ff][B]exists[/B][/COLOR][/FONT]
[FONT=Verdana]                [COLOR=#0433ff][B]delay[/B][/COLOR] 0.2[/FONT]
[FONT=Verdana]            [B]end[/B] [B]repeat[/B][/FONT]
[FONT=Verdana]            [COLOR=#0433ff][B]delay[/B][/COLOR] 0.1[/FONT]
[COLOR=#812FDC][FONT=Verdana][COLOR=#000000]            [/COLOR][COLOR=#0433ff][B]keystroke[/B][/COLOR][COLOR=#000000] "g" [/COLOR][COLOR=#0433ff]using[/COLOR][COLOR=#000000] {[/COLOR][I]command down[/I][COLOR=#000000], [/COLOR][I]shift down[/I][COLOR=#000000]}[/COLOR][/FONT][/COLOR]
[FONT=Verdana]            [COLOR=#0433ff][B]delay[/B][/COLOR] 0.5[/FONT]
[COLOR=#0433FF][FONT=Verdana][COLOR=#000000]            [/COLOR][B]keystroke [/B][COLOR=#4f8f00]pos_path[/COLOR][/FONT][/COLOR]
[COLOR=#0433FF][FONT=Verdana][COLOR=#000000]            [/COLOR][B]keystroke [/B][COLOR=#812fdc]return[/COLOR][/FONT][/COLOR]
[FONT=Verdana]            [COLOR=#0433ff][B]delay[/B][/COLOR] 0.5[/FONT]
[COLOR=#0433FF][FONT=Verdana][COLOR=#000000]            [/COLOR][B]keystroke [/B][COLOR=#812fdc]return[/COLOR][/FONT][/COLOR]
[FONT=Verdana]        [B]end[/B] [B]tell[/B][/FONT]
[COLOR=#4F8F00][FONT=Verdana][COLOR=#000000]        [B]tell[/B] [/COLOR][COLOR=#0433ff][I]window [/I][/COLOR]add_events[/FONT][/COLOR]
[FONT=Verdana]            [B]repeat[/B] [B]until[/B] ([B]it[/B] [COLOR=#0433ff][B]exists[/B][/COLOR])[/FONT]
[FONT=Verdana]                [COLOR=#0433ff][B]delay[/B][/COLOR] 0.2[/FONT]
[FONT=Verdana]            [B]end[/B] [B]repeat[/B][/FONT]
[COLOR=#0433FF][FONT=Verdana][COLOR=#000000]            [/COLOR][B]click [/B][I]pop up button[/I][COLOR=#000000] 1[/COLOR][/FONT][/COLOR]
[FONT=Verdana]            [B]repeat[/B] [B]until[/B] ([COLOR=#0433ff][I]menu[/I][/COLOR] 1 [B]of[/B] [COLOR=#0433ff][I]pop up button[/I][/COLOR] 1 [COLOR=#0433ff][B]exists[/B][/COLOR])[/FONT]
[FONT=Verdana]                [COLOR=#0433ff][B]delay[/B][/COLOR] 0.2[/FONT]
[FONT=Verdana]            [B]end[/B] [B]repeat[/B][/FONT]
[COLOR=#0433FF][FONT=Verdana][COLOR=#000000]            [/COLOR][B]click [/B][I]menu item [/I][COLOR=#4f8f00]cal_name[/COLOR][COLOR=#000000] [B]of[/B] [/COLOR][I]menu[/I][COLOR=#000000] 1 [B]of[/B] [/COLOR][I]pop up button[/I][COLOR=#000000] 1[/COLOR][/FONT][/COLOR]
[FONT=Verdana]            [B]repeat[/B] [B]while[/B] ([COLOR=#0433ff][I]menu[/I][/COLOR] 1 [B]of[/B] [COLOR=#0433ff][I]pop up button[/I][/COLOR] 1 [COLOR=#0433ff][B]exists[/B][/COLOR])[/FONT]
[FONT=Verdana]                [COLOR=#0433ff][B]delay[/B][/COLOR] 0.2[/FONT]
[FONT=Verdana]            [B]end[/B] [B]repeat[/B][/FONT]
[COLOR=#0433FF][FONT=Verdana][COLOR=#000000]            [/COLOR][B]click [/B][I]button[/I][COLOR=#000000] "OK"[/COLOR][/FONT][/COLOR]
[FONT=Verdana]        [B]end[/B] [B]tell[/B][/FONT]
[FONT=Verdana]    [B]end[/B] [B]tell[/B][/FONT]
[FONT=Verdana][B]end[/B] [B]tell[/B][/FONT]
[FONT=Verdana][B]tell[/B] [COLOR=#0433ff][I]application[/I][/COLOR] "Calendar"[/FONT]
[FONT=Verdana]    [B]repeat[/B] [B]until[/B] (([COLOR=#0433ff][B]count[/B][/COLOR] [COLOR=#0433ff][I]events[/I][/COLOR] [B]of[/B] [COLOR=#0433ff][I]calendar[/I][/COLOR] [COLOR=#4f8f00]cal_name[/COLOR]) > [COLOR=#4f8f00]c[/COLOR])[/FONT]
[FONT=Verdana]        [COLOR=#0433ff][B]delay[/B][/COLOR] 0.2[/FONT]
[FONT=Verdana]    [B]end[/B] [B]repeat[/B][/FONT]
[FONT=Verdana][B]end[/B] [B]tell[/B][/FONT]
[COLOR=#000000][FONT=Verdana][B]tell[/B] [/FONT][/COLOR][I]application[/I][COLOR=#000000][FONT=Verdana] "Finder" [B]to[/B] [/FONT][/COLOR][B]delete [/B][I]file [/I][COLOR=#4F8F00][FONT=Verdana]file_path[/FONT][/COLOR]
 
Expected Zeilenende, etc. but found Programmkonstante oder „considering“.
 
Bitte nochmal den Code kopieren, beim Einfügen hier gibt es immer Formatierungsfehler und ich hab's nicht geschafft die so schnell zu korrigieren ;)
 
jetzt hat er mich aufgefordert eine ics Datei auszusuchen. dann öffnet er den Kalender und nix passiert
 
Dann fürchte ich kann ich dir nicht weiterhelfen, vielleicht nutzt ja jemand anderes noch Mavericks. Apple scheint da leider einiges geändert zu haben.
 
hmmm...also der obere Code in meinem Eingangspost funktioniert ja bei mir so weit. Mit dem kann ich immerhin eine Datei importieren, nur eben nicht automatisch annehmen...kannst du mir da vielleicht noch weiterhelfen.
 
Die Einladung anzunehmen geht wenn dann über GUI-Scripting, und bei unterschiedlichen Betriebssystemen kann ich dir da leider nicht weiterhelfen.

Wenn du dich selbst daran versuchen möchtest, dann hilft dir sicher der Accessibility Inspector, der sich mit Xcode downloaden lässt. Solltest du kein Xcode haben, dann gibt es hier auch noch den Vorgänger: https://developer.apple.com/library...doc/uid/DTS10000728-Intro-DontLinkElementID_2
 
Hey Pill,
hast du den Skript Code den du oben gepostet hast noch einmal da? Den hats irgendwie zerschossen.
Danke Raik
 
Hallo,

kopiere den "zerschossenen" Code, füge ihn unten in das Antworten Feld ein. Dann wechsele zum ASCII/BBCode-Editor und wieder zurück zum Rich-Text_Editor ... eventuell reicht es stattdessen auch schon, auf "weitere Einstellungen" zu klicken

Gruß
 
Zurück
Oben Unten