![]() ![]() ![]() Note that the key combination can be customized to your liking just by changing the second line of my code. Then when in the journal’s site, and with hammerspoon active, you just hit the combo ‘cmd’ + ‘alt’ + ‘ctrl’ + ‘h’ and voila, a new tab is opened with the paper you were after. Hammerspoon is an application you run in the background that loads custom Lua scripts to interact with your system, allowing you to script behaviors to react to system events. `local newtab = hs.osascript.applescript(command_to_open)` (Whoa.) It's optimized for keeping you on the home row, or very close to it. It's like a secret keyboard inside your keyboard. `local command_to_open = ‘tell app “safari” to set the url of (make new tab in window 1) to “https:/sci-hub.tw/’. General Hammerspoon utilities The BTTrestartHammerspoon function sets up a BetterTouchTool widget which also executes the configreload action from the spoon. To activate, push the s and d keys simultaneously and hold them down. `local bo, obj, desc = hs.osascript.applescript(‘tell app “safari” to get the url of current tab of window 1’)` `– get url of current active safari window` It can display notifications, move windows, talk to other. `– SCI-HUB with CMD + ALT + CTRL + h on safari tab` Like an actual hammer combined with an actual spoon, it does almost everything you could possibly want. Like an actual hammer combined with an actual spoon, it does almost everything you could possibly want. So I automated the task with a function and a keybinding programmed in lua for those of you using (the wonderful!) hammerspoon. In contrast to other browsers, there’s no legal (is that the word?) Safari extension to open current publication without having to load sci-hub site and pasting the url. to use keyboard shortcuts to switch between thes. macOS Sierra added the ability to use tabs with any document-based app. hs.tabs.tabWindows(app) Type: Function: Description: Gets a list of the tabs of a window: Parameters: app - An hs. Typical scenario: using Safari to search for a reference, end up at a journal’s site to which I have no access. Add API for focusing OSX tabs by trishume Pull Request 1513 Hammerspoon/hammerspoon GitHub macOS Sierra added the ability to use tabs with any document-based app. ![]()
0 Comments
Leave a Reply. |