Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Select a calendar' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Select a calendar
Authored by: paulrob on Feb 11, '04 01:45:28PM
Add the following subroutine:-

on get_cal_titles()               (*gets a list of strings of calendar titles*)
	set list_of_cals to {}
	tell application "iCal"
		repeat with aCal in calendars
			set list_of_cals to list_of_cals & (title of aCal as string)
		end repeat
	end tell
	return list_of_cals
end get_cal_titles
Replace the line in the original script that goes:-

    set theItem to (make new todo at end of todo of calendar 1)
with:-

set callist to my get_cal_titles()   (*get cal titles*)
set selectedcals to (choose from list callist) as Unicode text (*do menu with cal titles*)
set thecal to first calendar whose title is selectedcals (*identify selected cal in iCal*)
set theItem to (make new todo at end of todo of thecal)
Sorted! A simple menu will now appear to allows a calendar to be selected. Extra features can be added to the "choose from list ..." command. Check the Standard Additons dictionary for more.

[ Reply to This | # ]
Select a calendar
Authored by: paulrob on Feb 11, '04 01:48:15PM

Oops! There should be an "s" on the last "todo" in the above script, me thinks.



[ Reply to This | # ]
Select a calendar
Authored by: cjackson@class.c on Feb 11, '04 02:02:10PM

Sweet! That was a feature that I tried to implement, but I'm still learning Applescript. Next up is making a new event from the address book.



[ Reply to This | # ]
Select a calendar
Authored by: saltydog4791 on Feb 11, '04 03:32:39PM

Hey paulrob,

Thanks for adding that functionality, but I cannot get it to work. Would you mind reposting the entire revised script so I can try again? Thanks a lot.

saltydog4791



[ Reply to This | # ]