Skip to content

Instantly share code, notes, and snippets.

@akashkahalkar
Created June 6, 2019 15:37
Show Gist options
  • Save akashkahalkar/3c4db6afb679c6b7205fccb882c98eb8 to your computer and use it in GitHub Desktop.
Save akashkahalkar/3c4db6afb679c6b7205fccb882c98eb8 to your computer and use it in GitHub Desktop.
Apple script to automatically start items after login
set apps to {"safari", "itunes"}
repeat with appToStart in apps
tell application appToStart to launch
delay 2
end repeat
delay 5
tell application "Safari"
if it is not running then
launch
end if
open location "https://www.google.com"
end tell
@akashkahalkar
Copy link
Author

Line 1: defines the array of app name that you wish to start.
Line 2 to 5: script will loop over each app and launch it. each with delay of 2 seconds.
Line 6: adds delay of 5 seconds.
Line 7 to 12: check if safari is running. if not then script will start safari and open specified url.

Add more application in apps array at line 1 for opening more applications.
change URL at line 11 to whatever you wish to open at start.

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