- Registriert
- 11.05.10
- Beiträge
- 199
Hi,
habe mir ein Script gebastelt um einen abonnierten Kalender zu exportieren und in den meinen Exchange-Kalender (in iCal) zu importieren. Klappt soweit ganz gut, aber leider muss ich den Kalender vorher anklicken, damit es auch funktioniert:
Wie kann ich im Script einen Kalender auswählen zum Export?
Jemand eine Idee?
Danke im Voraus!
brasax
habe mir ein Script gebastelt um einen abonnierten Kalender zu exportieren und in den meinen Exchange-Kalender (in iCal) zu importieren. Klappt soweit ganz gut, aber leider muss ich den Kalender vorher anklicken, damit es auch funktioniert:
Code:
on menu_click(mList)
local appName, topMenu, r
-- Validate our input
if mList's length < 3 then error "Menu list is not long enough"
-- Set these variables for clarity and brevity later on
set {appName, topMenu} to (items 1 through 2 of mList)
set r to (items 3 through (mList's length) of mList)
-- This overly-long line calls the menu_recurse function with
-- two arguments: r, and a reference to the top-level menu
tell application "System Events" to my menu_click_recurse(r, ((process appName)'s ¬
(menu bar 1)'s (menu bar item topMenu)'s (menu topMenu)))
end menu_click
on menu_click_recurse(mList, parentObject)
local f, r
-- `f` = first item, `r` = rest of items
set f to item 1 of mList
if mList's length > 1 then set r to (items 2 through (mList's length) of mList)
-- either actually click the menu item, or recurse again
tell application "System Events"
if mList's length is 1 then
click parentObject's menu item f
else
my menu_click_recurse(r, (parentObject's (menu item f)'s (menu f)))
end if
end tell
end menu_click_recurse
tell application "iCal" to activate
menu_click({"iCal", "Ablage", "Exportieren …", "Exportieren …"})
tell application "System Events"
keystroke return
end tell
tell application "iCal" to activate
menu_click({"iCal", "Ablage", "Importieren …", "Importieren …"})
tell application "System Events"
keystroke return
keystroke "RTM.ics"
keystroke return
delay 1
keystroke return
delay 1
keystroke return
end tell
Wie kann ich im Script einen Kalender auswählen zum Export?
Jemand eine Idee?
Danke im Voraus!
brasax