Skip to content

Instantly share code, notes, and snippets.

@laurentedel
Created May 15, 2015 22:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save laurentedel/a8b98498a8f742130045 to your computer and use it in GitHub Desktop.
Save laurentedel/a8b98498a8f742130045 to your computer and use it in GitHub Desktop.
applescript working place
(*
This script is supposed to be exported as "run only"
and crontabed
You must have a "WORKING_PLACE" category in Outlook
It'll simply ask you the location of working for today
and add a fullday event to your calendar
*)
tell application "Microsoft Outlook"
set theName to "[WORKING PLACE]"
set theCategory to "WORKING_PLACE"
set theContent to ""
set start_time to (current date)
set time of start_time to 60 * 60 * 9
set now to (current date)
set today to now - (time of now)
set tomorrow to (today) + (24 * 60 * 60)
set theConferenceList to every calendar event whose (subject contains "[WORKING PLACE]" and start time is greater than or equal to today)
if ((count of theConferenceList) = 0) then
display dialog "Where are you working today?" default answer "-"
set working_place to text returned of result
set newEvent to make new calendar event with properties {subject:theName, location:working_place, category:{category theCategory}, all day flag:true, has reminder:false, reminder time:0, free busy status:busy, is private:false, content:theContent, start time:today, end time:tomorrow}
end if
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment