Documentation Archive

Developer

Calendar Scripting Guide

Switching Calendar Views

Use the switch view command to change the display of the calendar window to day, week, or month view, as demonstrated in Listing 6-1 and Listing 6-2.

APPLESCRIPT

Open in Script Editor

Listing 6-1AppleScript: Switching the calendar to day view
  1. tell application "Calendar"
  2. switch view to day view
  3. end tell

JAVASCRIPT

Open in Script Editor

Listing 6-2JavaScript: Switching the calendar to week view
  1. var Calendar = Application("Calendar")
  2. Calendar.switchView({to: "week view"})