Last active
August 29, 2015 14:09
-
-
Save limamedeiros/7a5bf310f4ce66b2f1cb to your computer and use it in GitHub Desktop.
Opens Safari's current tab in Private Browsing
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 "Safari" | |
activate | |
set theURL to the URL of the current tab of the front window | |
close current tab of window 1 | |
end tell | |
tell application "System Events" | |
tell process "Safari" | |
tell menu bar 1 | |
click menu bar item "File" | |
tell menu "File" | |
click menu item "New Private Window" | |
end tell | |
end tell | |
end tell | |
end tell | |
tell application "Safari" | |
set URL of document 1 to theURL | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment