Skip to content

Instantly share code, notes, and snippets.

@talkingmoose
Created April 1, 2012 18:30
Show Gist options
  • 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
@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