Created
June 6, 2019 15:37
-
-
Save akashkahalkar/3c4db6afb679c6b7205fccb882c98eb8 to your computer and use it in GitHub Desktop.
Apple script to automatically start items after login
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.