Skip to content

Instantly share code, notes, and snippets.

@helms-charity
Forked from davejlong/archive.applescript
Created November 11, 2017 05:45
Show Gist options
  • Save helms-charity/7f02b446a936d91fa7d44de94eff83a7 to your computer and use it in GitHub Desktop.
Save helms-charity/7f02b446a936d91fa7d44de94eff83a7 to your computer and use it in GitHub Desktop.
Rebuilding Quick Actions in Outlook for Mac
(*
Script to Mark Item as Read and Move to folder "Archive"
For Microsoft Outlook 15
*)
tell application "Microsoft Outlook"
activate
set msgSet to current messages
if msgSet = {} then
error "No Messages selected. Select at least one message."
error -128
end if
set theMsg to item 1 of msgSet
set theAccount to account of theMsg
set archiveFolder to folder "Archive" of theAccount
repeat with aMessage in msgSet
set aMessage's is read to true
move aMessage to archiveFolder
end repeat
end tell
(*
Create Appointment from Message
Copyright (c) Microsoft Corporation. All rights reserved.
*)
tell application .Microsoft Outlook.
. get the currently selected message or messages
set selectedMessages to current messages
. if there are no messages selected, warn the user and then quit
if selectedMessages is {} then
display dialog .Please select a message first and then run this script.. with icon 1
return
end if
repeat with theMessage in selectedMessages
. get the information from the message, and store it in variables
set theName to subject of theMessage
set theCategory to category of theMessage
set thePriority to priority of theMessage
set theContent to content of theMessage
set myDate to current date
. create a new appointment with the information from the message
set newAppointment to make new calendar event with properties {subject:theName, content:theContent, start time:myDate + 1 * hours, end time:myDate + (2 * hours)}
end repeat
. if there was only one message selected, then open that new task
if (count of selectedMessages) = 1 then open newAppointment
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment