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
function setDefaultBrowser(appFileName, notify) | |
local logger = hs.logger.new('defbr', 5) | |
local app = hs.application.open('com.apple.systempreferences') | |
local axapp = hs.axuielement.applicationElement(app) | |
-- Attempt to open the menu until it successfully opens (returns true) | |
hs.timer.waitUntil(function() | |
return app:selectMenuItem({'View', 'General'}) | |
end, function() | |
print('General group opened.') |
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
#!nodem | |
// vim: set syntax=javascript : | |
foo // undefined, check reported line number |
OlderNewer