Last active
July 7, 2019 11:55
-
-
Save edenwaith/3e8dc9877c3238ba50be9ee78faf0616 to your computer and use it in GitHub Desktop.
Lock the screen in macOS High Sierra using an AppleScript
This file contains 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
tell application "System Events" to tell process "Finder" | |
-- Menu bar item 1 is the Apple menu | |
click menu item "Lock Screen" of menu 1 of menu bar item 1 of menu bar 1 | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment