Documentation Archive

Developer

Calendar Scripting Guide

Showing a Specific Date

Use the view calendar command to show a specific date in the calendar window. Listing 7-1 and Listing 7-2 show the current date.

APPLESCRIPT

Open in Script Editor

Listing 7-1AppleScript: Showing a specific date
  1. tell application "Calendar"
  2. view calendar at current date
  3. end tell

JAVASCRIPT

Open in Script Editor

Listing 7-2JavaScript: Showing a specific date
  1. var app = Application.currentApplication()
  2. app.includeStandardAdditions = true
  3. var Calendar = Application("Calendar")
  4. var date = app.currentDate()
  5. Calendar.viewCalendar({at: date})