MacGeeky Posted June 3, 2013 Share Posted June 3, 2013 (edited) BrowserTabs Features Close background windows in browser (Chrome/Safari) Close all tabs to the right or left of the active tab in Safari and Google Chrome with a keyboard shortcut Move to the next (right) / previous (left) tab with keyboard shortcuts Move to the first or last tab in the Safari/Chrome window with keyboard shortcuts Install the workflow, add your own shortcuts for each command. Help for the keyboard shortcut setup: closeLeftTabs - closes all tabs to the left closeRightTabs - closes all tabs to the right nextTab - switches to the next tab (to the right) previousTab - switches to the previous tab (to the left) lastTab - activates the first tab, to the left firstTab - activates the last tab, to the right closeBackgroundWindows - closes all background windows in Safari/Chrome CloseOtherTabs - New feature (Google Chrome only): Close all other tabs with a keyboard shortcut copyURL - copy the URL of the frontmost tab in Safari/Chrome to the clipboard CopyURLandTitle - copy the URL and title of the frontmost tab in Safari/Chrome to the clipboard Download BrowserTabs Download BrowserTabs 1.22 Download BrowserTabs 1.23 (Optional: Download BrowserTabs 1.23.1 - additional shortcuts available for choosing tab 1 through 9 by individually shortcuts. Examples: cmd+option+1 for tab 1, cmd+option+2 for tab 2, etc) Edited July 8, 2013 by MacGeeky twinpeaks 1 Link to comment
MacGeeky Posted June 26, 2013 Author Share Posted June 26, 2013 New version (1.22): New feature - close all other tabs in Google Chrome (with a keyboard shortcut) Download Link to comment
MacGeeky Posted June 27, 2013 Author Share Posted June 27, 2013 New version (1.23): New features copy the URL of the frontmost tab of Safari/Chrome to the cliplboard copy the URL and title of the frontmost tab of Safari/Chrome to the clipboard Download Link to comment
myrison Posted July 5, 2013 Share Posted July 5, 2013 MacGeeky - this is awesome, thank you for creating it. One suggestion/request for you would be to create additional shortcut options so that tabs 2-9 can be directly selected via keyboard shortcut as well (like Chrome/Firefox does it, and Safari does not). I'm not savvy enough to edit your 'firstTab' shortcut to do the others, but if you could add them I'd be quite grateful. Just in case that's not clear, what I'm talking about is: FirstTab = Command-1 (or whatever custom shortcut a user wants) SecondTab = Command-2 (or custom) etc.. Thanks again for posting. It's a really useful workflow. Link to comment
MacGeeky Posted July 8, 2013 Author Share Posted July 8, 2013 (edited) myrison - I could make a version for you with these options, but I don't think I'll implement it in the official version because the setup would be too cluttered in my opinion. I'll make a special version for you, and post it when it finished Here's a new version with support for choosing between the first 9 tabs in Chrome/Safari with a shortcut. Download BrowserTabs (with support for choosing tabs by number) Edited July 8, 2013 by MacGeeky myrison 1 Link to comment
myrison Posted July 8, 2013 Share Posted July 8, 2013 Thanks a ton. This is hugely useful for me (and hopefully a few other people as well). Hopefully future googlers are able to find their way here. I know from searching for a solution before coming here that there are at least a few people looking for this same implementation. I'll post links where I can to provide more exposure to Alfred and your script MacGeeky. Let me know if I can buy you a beer. MacGeeky 1 Link to comment
MacGeeky Posted July 14, 2013 Author Share Posted July 14, 2013 Added support for Alleyoop updates! Download and install the Alleyoop workflow to search for new updates in this workflow, and other workflows supporting it. Link to comment
mshucker Posted December 21, 2013 Share Posted December 21, 2013 This is exactly what I have been looking for! Wanting command-tab# is the only reason I haven't been using Safari. Thanks! Link to comment
kieropipas Posted May 27, 2014 Share Posted May 27, 2014 Hmm, it doesn't work for me... No action I set does really do anything in Safari for me (MBP 2009, Mavericks). Did something change or is it still working for you guys? Link to comment
enigma2k Posted May 27, 2014 Share Posted May 27, 2014 Is it possible to add the feature to switch between the last active tab and your current tab? Link to comment
twinpeaks Posted May 27, 2014 Share Posted May 27, 2014 This script is great but way too hotkey intensive for me to use as much as I'd like. - Anyway to get a scriptfilter set to optional? Start typing and you filter down the list to the command your looking for but in this way not necessary to remember the variables or the hotkeys as they are listed automatically in alfred's menu... That would make this so much more useful for me. I will play around some more and see if I can get it working off the example of another workflow but I tried before and got discouraged so I'll let you know but 1+ days you can be sure I have threw in the towel. Cheers! Link to comment
politicus Posted August 18, 2014 Share Posted August 18, 2014 @MacGeeky Excellent workflow! I was looking for that workflow for a long time. Two features requests: - A "the last active tab / your current tab" switcher would be awesome - A close the tab right/left to the current tab would be awesome too. Link to comment
politicus Posted September 16, 2014 Share Posted September 16, 2014 If you want a "last active tab / your current tab" switcher. There is a little Google Chrome extension called "Recent Tabs". HTH. Link to comment
MacGeeky Posted October 12, 2014 Author Share Posted October 12, 2014 (edited) Hmm, it doesn't work for me... No action I set does really do anything in Safari for me (MBP 2009, Mavericks). Did something change or is it still working for you guys? I haven't updated the extension for 10.9 yet, but I'm (only) assuming it's related to the change in security and Accessability Preferences - you have to manually accept each application that uses GUI scripting (this extension does) in Preferences => Accessability. Here's Apples support page for this solution: http://support.apple.com/kb/HT6026 Edited October 29, 2014 by MacGeeky Link to comment
sesweitzer Posted August 14, 2016 Share Posted August 14, 2016 Greetings, I have a new Mac and I'm trying to use a workflow with Alfred 3 called Browsertabs that, among other things, closes all Safari tabs to the left or to the right. This workflow works fine on two of my Macs (all running El Capitan). I Exported it from a working version of Alfred 3 and then Imported it to the new Mac by double clicking on it. After I add a shortcut key combination, I get this error: Starting debug for 'BrowserTabs' [2016-08-14 11:45:25][trigger.hotkey] Processing output of 'action.applescript' with arg 'closeRightTabs' [2016-08-14 11:45:25][ERROR: action.applescript] { NSAppleScriptErrorBriefMessage = "Expected end of line, etc. but found property."; NSAppleScriptErrorMessage = "Expected end of line, etc. but found property."; NSAppleScriptErrorNumber = "-2741"; NSAppleScriptErrorRange = "NSRange: {2239, 3}"; Any suggestion? Steve Link to comment
deanishe Posted August 14, 2016 Share Posted August 14, 2016 If you're having a problem with a workflow, you should ask in that workflow's thread (if there is one). In any case, please post a link to the workflow. Can't tell you what's wrong without it. Link to comment
sesweitzer Posted August 15, 2016 Share Posted August 15, 2016 This is the link http://www.alfredforum.com/topic/2580-browsertabs-chromesafari-close-tabs-to-the-leftright-switch-between-tabs-with-keyboard/ The first time I ran it with Safari open I got a window asking where Chrome was located. I don't have Chrome on this Mac. This is the AppleScript on alfred_script(q) -- find front app tell application "System Events" set frontApp to name of the first process whose frontmost is true end tell if frontApp is "Safari" then if q is "tab1" then tell first window of application "Safari" to set current tab to tab 1 else if q is "tab2" then tell first window of application "Safari" to set current tab to tab 2 else if q is "tab3" then tell first window of application "Safari" to set current tab to tab 3 else if q is "tab4" then tell first window of application "Safari" to set current tab to tab 4 else if q is "tab5" then tell first window of application "Safari" to set current tab to tab 5 else if q is "tab6" then tell first window of application "Safari" to set current tab to tab 6 else if q is "tab7" then tell first window of application "Safari" to set current tab to tab 7 else if q is "tab8" then tell first window of application "Safari" to set current tab to tab 8 else if q is "tab9" then tell first window of application "Safari" to set current tab to tab 9 end if else if frontApp is "Google Chrome" then if q is "tab1" then tell application "Google Chrome" to set active tab index of first window to 1 else if q is "tab2" then tell application "Google Chrome" to set active tab index of first window to 2 else if q is "tab3" then tell application "Google Chrome" to set active tab index of first window to 3 else if q is "tab4" then tell application "Google Chrome" to set active tab index of first window to 4 else if q is "tab5" then tell application "Google Chrome" to set active tab index of first window to 5 else if q is "tab6" then tell application "Google Chrome" to set active tab index of first window to 6 else if q is "tab7" then tell application "Google Chrome" to set active tab index of first window to 7 else if q is "tab8" then tell application "Google Chrome" to set active tab index of first window to 8 else if q is "tab9" then tell application "Google Chrome" to set active tab index of first window to 9 end if end if end alfred_script Link to comment
deanishe Posted August 15, 2016 Share Posted August 15, 2016 (edited) Merged sesweitzer's thread with this one. Edited August 15, 2016 by deanishe Link to comment
deanishe Posted August 15, 2016 Share Posted August 15, 2016 The first time I ran it with Safari open I got a window asking where Chrome was located. I don't have Chrome on this Mac. I think that breaks the workflow. AppleScript chokes if there's a "tell" clause whose target application isn't installed. Unless someone has a better idea, you could try installing Chrome or removing the parts of the workflow that refer to it. Link to comment
kodiak Posted April 10, 2018 Share Posted April 10, 2018 Hello, I've been trying to download this but the link is broken. Any chance for a working one? Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now