I need to remember that simple and effective are not antonyms. I often forget to blog about these simple automations. The same idea could be used on any browser that has a keyboard shortcut for switching tabs. Nothing for Firefox, unfortunately, but you can use AppleScript and UI scripting: applescript:Ĥ: keystroke "]" using Īs with my old AppleScripts for Safari, this will cause a brief flash. If you’re a Chrome user, Keyboard Maestro has similar actions for switching tabs there. If you want to switch tabs in a shortcut, it looks like you’ll have to call out to AppleScript. Now that we’ve entered the brave new world of Shortcuts on the Mac, you might be wondering if this can be done without Keyboard Maestro or AppleScript. But it’s more convenient to have both “next” and “previous” available, just as it is when you’re working in Safari itself.) (Strictly speaking, only one of these macros is necessary, as the tabs act as a loop when you get to the rightmost tab, the “next” tab is the leftmost one. It wasn’t particularly distracting, but once I learned that Keyboard Maestro could do the tab switch in the background, I stopped using the AppleScripts. These worked, but there was a brief flash as Safari came to the front, did its tab switch, and then retreated as BBEdit was made frontmost again. Here’s one of them: applescript:Ĥ: click menu item "Show Next Tab" of menu "Window" of menu bar 1Ħ: tell process "BBEdit" to set frontmost to true They were kept in BBEdit’s Scripts folder and were also bound to ⇧⌘] and ⇧⌘[. When I get to the right page, I use ⌃L to add a link to it.īefore I bought Keyboard Maestro, I had AppleScripts that worked similarly but not as smoothly. The Safari window in the background updates with every tab switch, so I can see what page it’s on. With these two macros, I can navigate between Safari tabs just as I would if Safari were the active application. There’s a similar one that uses the Previous Safari Tab action and is bound to ⇧⌘[. To avoid that, I use this one-step Keyboard Maestro macro: The app switching is an unnecessary interruption. But if I want to link to one of the other tabs, I have to bring Safari forward, switch tabs, go back to BBEdit, and add the link. If the page I want to link to is in the current tab, my linking automation works wonderfully. Most of the time, I have BBEdit in the foreground and Safari behind it, with some number of Safari tabs open to the pages I expect to link to in the post. And yet it’s just as important in keeping me on track. But there’s another automation I use in conjunction with it that I’ve never written about because it’s so ridiculously simple. Its great value is that it lets me add a link by just pressing ⌃L-no switching between BBEdit and Safari or messing around with the clipboard. It’s kind of involved, including both Python and AppleScripting of BBEdit to add a Markdown reference link to the bottom of the current document and put the cursor back where it belongs. I’ve written before about the automation I use when writing a blog post to quickly add a link to the frontmost Safari page. Next post Previous post Switching Safari tabs from BBEdit
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |