Created
December 25, 2014 13:21
-
-
Save oal/e965bc6fd031f27f9f86 to your computer and use it in GitHub Desktop.
Restart Safari and reopen all windows and tabs from previous session.
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
function run() { | |
// Quit | |
var safari = Application('Safari'); | |
safari.activate(); | |
safari.quit() | |
// Reopen safari | |
safari.activate(); | |
// Get menu | |
var se = Application('System Events'); | |
var proc = se.processes.byName('Safari'); | |
var logMenu = proc.menuBars[0].menuBarItems[5]; | |
// Reopen from last session | |
// Replace string with whatever "Open all windows from previous session" is in your language | |
logMenu.menus[0].menuItems.byName('Åpne alle vinduer fra forrige økt på nytt').click(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment