Skip to content

Instantly share code, notes, and snippets.

@talkingmoose
Created April 1, 2012 18:30
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save talkingmoose/2277552 to your computer and use it in GitHub Desktop.
Save talkingmoose/2277552 to your computer and use it in GitHub Desktop.
Outlook for Mac AppleScript to create an event from a task
(*
Create Event from Task
Copyright (c) Microsoft Corporation. All rights reserved.
Modified by William Smith.
*)
tell application "Microsoft Outlook"
-- get the currently selected task or tasks
set selectedTasks to selection
-- if there are no tasks selected, warn the user and then quit
if selectedTasks is {} then
display dialog "Please select a task first and then run this script." with icon 1
return
end if
repeat with theTask in selectedTasks
-- get the information from the message, and store it in variables
set theName to name of theTask
set theCategory to category of theTask
set theContent to content of theTask
if theContent is missing value then
set theContent to ""
end if
-- create a new event with the information from the task
set newEvent to make new calendar event with properties {subject:theName, category:theCategory, content:theContent, start time:(current date) + 1800, end time:(current date) + 3600}
-- if there was only one task selected, then open that new note
if (count of selectedTasks) = 1 then open newEvent
end repeat
end tell
@talkingmoose
Copy link
Author

Instructions:

  1. Click the Download button above to download the compressed file.
  2. Locate and double-click the downloaded file to decompress it.
  3. In Outlook for Mac select AppleScript menu (to the right of the Help menu) --> About This Menu...
  4. Click the Open Folder button to open the Outlook Script Menu Items folder.
  5. Drag the Create Event from Task\cmE.scpt file into the Outlook Script Menu Items folder.

To use the script select a task and then select Create Event from Task\cmE from the AppleScript menu.

@EmilVarona
Copy link

Hi,
Thanks for the script. I'm trying to create a meeting invite from a selected message. I can create a calendar event but cannot seem to get recipients added. I've tried

set newMtg to (make new calendar event with properties {subject:"test"} with attendee given email address:"a.b.com")

then either

open newMtg

or

forward newMtg to "a@b.com"

and neither work. Any help would be great. Thanks.

@LukeNYoda
Copy link

Hello talkingmoose,

Can an Apple script be written to- Not allow any meeting invites show up as tentative on the outlook calendar? Then, the user has the option to manually accept the meetings they want.

Luke

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment