Skip to content

Instantly share code, notes, and snippets.

@MikeBirdTech
Last active September 1, 2023 20:59
Show Gist options
  • Save MikeBirdTech/5117c1be853e847264bce0437dfd0eb4 to your computer and use it in GitHub Desktop.
Save MikeBirdTech/5117c1be853e847264bce0437dfd0eb4 to your computer and use it in GitHub Desktop.
Start Work Day - On weekdays between 8-10 am, ask if I am starting my work day, and if so, open all my work apps
-- Get current day of the week
set currentDay to weekday of (current date) as string
-- Get the current time in seconds since midnight
set currentTime to time of (current date)
-- Convert the current time to hours
set currentHour to currentTime div 3600
-- Check if today is between Monday and Friday
if currentDay is in {"Monday", "Tuesday", "Wednesday", "Thursday", "Friday"} then
-- Check if current time is between 8 am and 10 am
if currentHour > 8 and currentHour < 10 then
-- Prompt user for work start
set startWork to display dialog "Are you starting your work day?" buttons {"Yes", "No"} default button 1
set startWorkResponse to button returned of startWork
-- Check user's response
if startWorkResponse is "Yes" then
-- List of applications to open
set applicationsToOpen to {"Slack", "Notion", "Brave Browser", "Postman", "Cursor", "iTerm", "Spotify", "MongoDB Compass"}
-- Loop through the list and open each application
repeat with appName in applicationsToOpen
tell application appName
activate
end tell
end repeat
end if
end if
end if
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment