• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Getting selected event in iCal
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting selected event in iCal


  • Subject: Re: Getting selected event in iCal
  • From: Tom Robinson <email@hidden>
  • Date: Mon, 28 Jan 2008 11:05:56 +1300

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:
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>)

  • Prev by Date: Re: Is Preview scriptable?
  • Next by Date: Re: Scripting Fontbook
  • Previous by thread: Re: Getting selected event in iCal
  • Next by thread: Re: Getting selected event in iCal
  • Index(es):
    • Date
    • Thread