Created
February 5, 2020 17:45
-
-
Save tomhodgins/031dc82b933051b84c76ebe06291b65b to your computer and use it in GitHub Desktop.
Use this with Apple's Script Editor to refresh the Chrome web browser and execute whatever is on your clipboard as JS
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
var app = Application('System Events') | |
app.includeStandardAdditions = true | |
var browser = Application('Chrome').windows[0].activeTab() | |
// Chrome | |
browser.reload() | |
function loadEnd(callback) { | |
return browser.loading() | |
? loadEnd(callback) | |
: callback() | |
} | |
loadEnd(e => browser.execute({javascript: app.theClipboard()})) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment