Hi,
I want to add an ics file to a specific ical calendar. If I use the following script to do this:
tell application "iCal"
activate
delay 2
try
open "/Users/jonasyde/Downloads/stuntnacht.ics"
on error
do shell script "open /Users/jonasyde/Downloads/stuntnacht.ics"
end try
delay 2
tell application "System Events"
tell window "Activiteiten toevoegen"
delay 2
click pop up button 1
delay 2
click menu item "Uitgaan" of menu 1 of pop up button 1
delay 2
click button "OK"
end tell
end tell
end tell
but I get the following error:
error "System Events kreeg een fout: window \"Activiteiten toevoegen\" kan niet worden opgevraagd. " number -1728 from window "Activiteiten toevoegen"
Apparently the script can’t find the “Activiteiten toevoegen” window, although it is the correct spelling (double checked) and the window is already fully loaded when the error appears.
(Since the script doesn’t recognize the window, using the code from http://macscripter.net/viewtopic.php?id=29010 doesn’t work)