iCal 5 fails Applescript request when not launched

Originator:john
Number:rdar://10049078 Date Originated:30-Aug-2011 11:24 PM
Status:Closed Resolved:
Product:iCal Product Version:5.0 (1535)
Classification:Bug Reproducible:Always
 
Summary:
iCal does not respond correctly to Applescript request for calendars if it is not launched. An empty list is returned.

Steps to Reproduce:
1. Make sure iCal is not running.
2. Copy the following single line into a blank Applescript Editor window.
    tell application "iCal" to calendars
3. Press Run and view the Results pane.

Expected Results:
iCal launches and the Results pane shows a list of iCal's calendar properties.

Actual Results:
iCal launches and the Results pane shows an empty list.

Regression:
This test works as expected with iCal 4. 

Notes:
The script works when iCal is running. It appears that iCal is not dealing with Applescript requests for calendar/event data in general when it is also being launched. 

e.g.: When iCal is not running the following line. 
tell application "iCal" to events of calendar 1
gives: 
error "iCal got an error: Can’t get calendar 1. Invalid index." number -1719 from calendar 1
This test works as expected when iCal is running.

Running counter to this is the results of the following:
tell application "iCal" to windows
(which gives a result)

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!