Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting selected event in iCal



On 2008-01-27, at 11:32, Christian D Boyce wrote:

I'm trying to do a few operations on a selected event. But I can't figure out how to reference it. The event is already made

I do this for a script I run over a selected To Do.

I fiddled it by issuing a copy command, then checking the contents of the clipboard. The same hack should work for an event:

tell application id "com.apple.iCal" to activate
tell application id "com.apple.systemevents"
	tell process "iCal"
		keystroke "c" using command down
	end tell
end tell
delay 1

set TimesheetSummary to first paragraph of (the clipboard)

-- Now we’ve got the summary from copying, find the ID the proper way

tell application id "com.apple.iCal"
	tell calendar "Work"
		set TimeSheets to every todo whose summary is TimesheetSummary
	end tell
end tell

_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-users/email@hidden
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden
References: 
 >Getting selected event in iCal (From: Christian D Boyce <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.