Jump to content

Rapid Browser Tabs: Search, activate, reload and close your active tabs and favourites - V1.1 Update Released August 8, 2015


Recommended Posts

Search, activate, reload and close your active Chrome and Safari tabs and favourite sites.

 

RBT allows you to do the following all from within Alfred:

  1. Search all open tabs across Chrome and Safari and load a selected tab.
  2. Reload a tab forcibly when you select it if you want.
  3. Add "favourite" sites to the workflow for quick access with defined keywords. 
  4. Synchronise your favourites across computers.  

 
RBT for Alfred has been forked from the Search Tabs on Safari and Chrome workflow developed by Clinton Strong (with Clinton's blessing) and could almost be considered v2 of Clinton's original workflow.

 

rbt_for_alfred_minidemo.gif
 
The below instructions are a clone of what is posted on the official Github repository:

 


UPDATE August 8, 2015 - Version 1.1 Released

Today I release v1.1 of Rapid Browser Tabs which has the following changes:

  • Fix - Tab icon for Safari did not display
  • Feature - Add "ctrl" key modifier to force reload tab on opening
  • Feature - Provide feedback on settings initialisation and sync
  • Feature - Enable favourite searching by URL


Installation

  1. Download the .alfredworkflow file or you can get it from Packal.
  2. Run to import into Alfred

Setup

Before you can do anything with the workflow you will need to initialise the settings:

  1. Run rbtsetup and select 'Initialise Workflow Configuration'
  2. The workflow will then copy over the default configuration files and example icons.

pre_config.png

 

 

The workflow has been designed to enable settings synchronisation via a mechanism of your choice (such as Dropbox). It is easiest to set this up before you get too deep into configuring the workflow.

To configure synchronisation via Dropbox (as an example):

  1. Run 'rbtsetup' and select "Set root config folder location"
  2. Update the folder name to point to a new location, my personal preference is "~/Dropbox/AlfredSync/Workflow Data/com.stuartryan.alfred.rapidbrowsertabs/" (however you can use any location as long as you set it to be the same on different computers)
  3. Ensure you have ended your path with a trailing forward slash (things will break if you don't) and then save and close the configuration file.
  4. If this is the first computer you are setting the workflow up on (i.e. that directory does not exist or is empty) run rbtsetup then select "Refresh workflow configuration" to copy the default configurations into place
  5. Repeat steps 1 to 3 for every subsequent computer you will run the workflow on (after the initial sync has completed via Dropbox).

configure_screen.png

 

 

Configure a hotkey: To make your life easier I also recommend you set up a hotkey for use with the workflow.

  1. Open Alfred
  2. Click Workflows --> Rapid Browser Tabs
  3. Double click on the Hotkey box
  4. Enter your hotkey and ensure the action is set to "Pass through to workflow"
  5. The argument should be set to "None"
  6. Click Save

Basic Usage

The default keyword set is "rbt" here are some examples of what you can do:

  • rbt google - Will show all tabs you currently have open that have google in the URL or the tab description.
  • rbt fb - FB is set as a keyword for Facebook. This will show any current Facebook tabs already open and will also allow you to open a new Facebook tab in your default browser as well.
  • rbt nf - Same thing as above but will open Netflix
  • rbt netflix - Same as above, workflow will recognise this is a favourite site and show all tabs currently open and will also offer the option to open a new tab to the Netflix website.
  • ctrl key modifier - The control key when held down while selecting a tab will force the tab to reload/refresh when it is opened

For backwards compatibility with the human brain (and the fact that everyone is used to using the keyword "tabs"), an additional entry point into the workflow using the keyword "tabs" has been added. Depending on user feedback this may be removed or adopted permanently in the future.

 

facebook_example.png

 

favourites_example.png

 

 

Advanced Configuration - Adding your own favourites YAML Config File

Once you have the hang of the basic usage of the workflow, you can get down to configuring extra "Favourites".

The favourites have been designed to represent the most used sites you use, the ones that you access day in and day out so that you can get rapid access to them.

I have found after setting these up originally I have only added to the list a couple of times as it is expected the list will become relatively static after the first couple of weeks usage.

To access the sites configuration:

  • Run rbtsetup then select "Modify Sites Configuration"
  • The default configuration example has examples that you can copy and modify to add your own favourites

The two basic styles of configuration are:

First Example:

YouTube:
    aliases: "-yt"
    icon: youtube.png
    url: "https://www.youtube.com"

Second Example:

? "YouTube Video Manager"
:
    aliases: "-yta -ytvm -youtube admin"
    icon: youtubeadmin.png
    url: "https://www.youtube.com/my_videos"

The key difference between the two above examples are the use of the '? "Site name"' in the second example. When the site name has spaces, you should copy the second example. You can however always opt to use this format regardless of whether the site name has spaces or not if you want to go the easy route.

The aliases section can list zero or more aliases (for zero just use "", and do not delete the line). Each alias should be prefixed by a dash '-', and you can have as many keywords as you would like (but remember... less is more).

If you are having problems with the site configuration you have created, a great first point is to run it through YAML Lint which can validate if there is anything invalid in your syntax. If that comes back clean and you still have issues please log an issue.

 

 

Adding the pretty favourite images

You will notice in the above example each item references a png icon file. You can save icons that you would like to represent your favourites in the icons folder. This is accessed by typing 'rbtsetup' then selecting "Open icons storage folder". As long as the icons in this folder match what you put on your text you can use a pretty icon.

If you would rather not use an image just use 'icon.png' and this will use the default icon for the workflow.

 

Supported Browsers

Currently the workflow supports the following browsers. As Firefox does not expose its tabs via Applescript, it is not able to be supported. If someone is a whizz at writing Firefox plugins and would like to collaborate on a plugin to get this to work please feel free to get into contact with me.

  • Chrome
  • Safari
  • Chromium
  • Chrome Canary
  • Webkit

History

  • Version 1.1 - Bugfix and feature release
    • Fix - Tab icon for Safari did not display
    • Feature - Add "ctrl" key modified to force reload tab on opening
    • Feature - Provide feedback on settings initialisation and sync
    • Feature - Enable favourite searching by URL
  • Version 1.0 - Initial Release of Rapid Browser Tabs for Alfred
  • Version 0.9 - Forked from Search Safari and Chrome Tabs workflow Feb 2014 release

Credits

Rapid Browser Tabs for Alfred workflow created by Stuart Ryan. If you would like to get into contact you can do so via:

Search Tabs on Safari and Chrome workflow created by Clinton Strong represented the initial stages for this workflow.

  • Clinton has been kind enough to provide his blessing for the code to be forked and maintained as a new workflow.
  • Any future code releases to the Search Tabs on Safari and Chrome workflow may be merged into this workflow if required (and as long as the original licensing permits).

License

All code in this workflow is released under the MIT License. Images used as part of the workflow are licensed only for use in this workflow and must be changed if the workflow is forked in the future.

All images have been licensed from DepositPhotos to Stuart Ryan.

 

Donations

This workflow represents many many hours effort of development, testing and rework. The images licensed for this workflow from DepositPhotos also needed a bit of my moolah. So if you love the workflow, and get use out of it every day, if you would like to donate as a thank you to buy me more caffeine giving Diet Coke, some Cake, or to put towards a shiny new gadget you can donate to me via Paypal.

 

donate.png

 

Contributing

If you are a coder head over to the official Github repo:

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

If you aren't a coder:

You can drop your ideas here or feel free to log your ideas and suggestions on GitHub and I will see what I can do.

Edited by stuartcryan
Link to comment

Today I happily release v1.1 of Rapid Browser Tabs which has the following changes:

  • Fix - Tab icon for Safari did not display
  • Feature - Add "ctrl" key modified to force reload tab on opening
  • Feature - Provide feedback on settings initialisation and sync
  • Feature - Enable favourite searching by URL
Link to comment

Might I suggest adding a paragraph at the beginning of the description that summarises exactly what the workflow does.

 

I've read the description through twice, and I still don't really understand what this workflow does. Many people won't bother reading beyond the first paragraph if something doesn't grab their attention.

 

Apparently, it allows me to set some favourites. It does something with tabs. Open them? Close them? Search them?

 

If I turn on sync, what does it sync? Open tabs? The favourites I set? Both?

Edited by deanishe
Link to comment

Might I suggest adding a paragraph at the beginning of the description that summarises exactly what the workflow does.

 

I've read the description through twice, and I still don't really understand what this workflow does. Many people won't bother reading beyond the first paragraph if something doesn't grab their attention.

 

Apparently, it allows me to set some favourites. It does something with tabs. Open them? Close them? Search them?

 

If I turn on sync, what does it sync? Open tabs? The favourites I set? Both?

 

Hi Deanishe,

Thanks so much for the feedback you raise a REALLY valid point (epic fail on my part).

 

I have now added a section describing exactly what the workflow does and what it can be used for (and how it can save you time).

 

Please let me know if that makes a little more sense. More than happy to revise it again if you (or any others) have any questions.

Cheers,
Stuart
Edited by stuartcryan
Link to comment
  • 2 weeks later...

Terrific workflow, donated.

 

OSX has dreadful support for separating off workspaces correctly (at least for my use cases, and I've paid for and tried a *lot* of possible add-on solutions), so much so that I've considered running multiple VMs just to keep things grouped and predictable.

 

Alfred and particularly this plugin go a long way towards taming that, thanks.

Link to comment

Thanks. Conscious I don't want to fill up a thread with general OSX gripes and that I'm new to Alfred, so I'll test drive for a bit.

 

One thing I've done is change the keyword from "rbt" to just "t" as it's very frequent use for me; is there any reason to steer clear of single char keywords that I haven't come across?

 

ETA: ah, and added a hotkey, handy

Edited by mrsean2k
Link to comment

 

One thing I've done is change the keyword from "rbt" to just "t" as it's very frequent use for me; is there any reason to steer clear of single char keywords that I haven't come across?

 

You know that is really interesting I actually had 'w' just for websites, but I thought the majority of the community might frown on a single letter (tho I never found issue with it at all).

 

If everyone is happy for a single letter I would be more than happy to make that the default?

 

(perhaps 't' would be best)?

 

And no worries at all, there is much learning using Alfred, I suggest you start small, get used to a few functions then add a few more, that is the best way (rather than loading up all the workflows and forgetting what you have and how to use it quickly).

Cheers,
Stuart
Link to comment

is there any reason to steer clear of single char keywords that I haven't come across?

 

It depends how you feel about workflow results being mixed in with Alfred's default results.

 

Personally, I really dislike mixing the two, so I tend to use keywords like .t or .sf. Short and the leading dot excludes Alfred's default results (any filename starting with "." is considered invisible and is ignored).

Link to comment
  • 3 months later...
  • 3 weeks later...
  • 8 months later...
5 minutes ago, stuartcryan said:

It is all working here for me, could you please try opening the debugger in the workflow (little bug icon) testing your browser tab search and posting the output?

 

Many thanks

Stuart

 

Thanks!

 

Here you have:

Quote

Starting debug for 'Rapid Browser Tabs'

 

[2016-09-21 00:12:41][ERROR: input.scriptfilter] Code 1: /Users/obazavil/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.5D307B52-E372-4129-969C-7D7C2126ABF1/browser_tabs/applescript_utils.rb:37:in `block in osascript': AppleScript error: 736:1236: execution error: Google Chrome got an error: every window doesn’t understand the “count” message. (-1708) (BrowserTabs::AppleScriptUtils::AppleScriptError)

    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/open3.rb:217:in `popen_run'

    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/open3.rb:99:in `popen3'

    from /Users/obazavil/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.5D307B52-E372-4129-969C-7D7C2126ABF1/browser_tabs/applescript_utils.rb:32:in `osascript'

    from /Users/obazavil/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.5D307B52-E372-4129-969C-7D7C2126ABF1/browser_tabs/applescript_utils.rb:18:in `run'

    from /Users/obazavil/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.5D307B52-E372-4129-969C-7D7C2126ABF1/browser_tabs/commands/command.rb:49:in `run'

    from /Users/obazavil/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.5D307B52-E372-4129-969C-7D7C2126ABF1/browser_tabs.rb:62:in `run_command'

    from /Users/obazavil/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.5D307B52-E372-4129-969C-7D7C2126ABF1/browser_tabs.rb:31:in `tabs'

    from load_list.rb:18:in `<main>'

[2016-09-21 00:12:46][ERROR: input.scriptfilter] Code 1: /Users/obazavil/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.5D307B52-E372-4129-969C-7D7C2126ABF1/browser_tabs/applescript_utils.rb:37:in `block in osascript': AppleScript error: 736:1236: execution error: Google Chrome got an error: every window doesn’t understand the “count” message. (-1708) (BrowserTabs::AppleScriptUtils::AppleScriptError)

    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/open3.rb:217:in `popen_run'

    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/open3.rb:99:in `popen3'

    from /Users/obazavil/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.5D307B52-E372-4129-969C-7D7C2126ABF1/browser_tabs/applescript_utils.rb:32:in `osascript'

    from /Users/obazavil/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.5D307B52-E372-4129-969C-7D7C2126ABF1/browser_tabs/applescript_utils.rb:18:in `run'

    from /Users/obazavil/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.5D307B52-E372-4129-969C-7D7C2126ABF1/browser_tabs/commands/command.rb:49:in `run'

    from /Users/obazavil/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.5D307B52-E372-4129-969C-7D7C2126ABF1/browser_tabs.rb:62:in `run_command'

    from /Users/obazavil/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.5D307B52-E372-4129-969C-7D7C2126ABF1/browser_tabs.rb:31:in `tabs'

    from load_list.rb:18:in `<main>'

 

Link to comment
Just now, obazavil said:

 

hehe...

 

is Version 53.0.2785.116 (64-bit)

 

i installed it via brew.. but i dont know if that has something to do

Interesting, I have never installed it via Brew, could you possibly (just for testing) try with a straight binary download of Chrome? I am using the same version and it seems OK here.

Oh also, what version of OSX are you running?
Cheers,
Stuart

 

Link to comment
Just now, stuartcryan said:

Interesting, I have never installed it via Brew, could you possibly (just for testing) try with a straight binary download of Chrome? I am using the same version and it seems OK here.

Oh also, what version of OSX are you running?
Cheers,
Stuart

 

 

I will try tomorrow switching versions and let you know.

 

sorry is using brew cask...

 

osx is capitan 10.11.6

Link to comment
7 hours ago, stuartcryan said:

Awesome, no worries at all, keep me posted.

 

Reinstalled Chrome using normal installer from google, same results... HOWEVER I noticed something interesting.

 

I have parallels and inside parallel is chrome for windows. I think RBT tries to access that chrome, because the the VM in parallels desktop launches automatically as soon as i type rbt, and I see the chrome windows icon in dock.

 

Log:

Quote

Starting debug for 'Rapid Browser Tabs'

 

[2016-09-21 08:50:06][ERROR: input.scriptfilter] Code 1: /Users/obazavil/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.5D307B52-E372-4129-969C-7D7C2126ABF1/browser_tabs/applescript_utils.rb:37:in `block in osascript': AppleScript error: 736:1236: execution error: Google Chrome got an error: every window doesn’t understand the “count” message. (-1708) (BrowserTabs::AppleScriptUtils::AppleScriptError)

    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/open3.rb:217:in `popen_run'

    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/open3.rb:99:in `popen3'

    from /Users/obazavil/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.5D307B52-E372-4129-969C-7D7C2126ABF1/browser_tabs/applescript_utils.rb:32:in `osascript'

    from /Users/obazavil/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.5D307B52-E372-4129-969C-7D7C2126ABF1/browser_tabs/applescript_utils.rb:18:in `run'

    from /Users/obazavil/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.5D307B52-E372-4129-969C-7D7C2126ABF1/browser_tabs/commands/command.rb:49:in `run'

    from /Users/obazavil/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.5D307B52-E372-4129-969C-7D7C2126ABF1/browser_tabs.rb:62:in `run_command'

    from /Users/obazavil/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.5D307B52-E372-4129-969C-7D7C2126ABF1/browser_tabs.rb:31:in `tabs'

    from load_list.rb:18:in `<main>'

 

 

Link to comment

Ok.. found a workaround.

 

Seems the index searches here also (when using spotlight or alfred):

/Users/obazavil/Applications (Parallels)/

 

And puts the stuff from that folder before the native chrome

 

so... i suppose rbt searches for the first chrome result, finds the parallel one, try to interact with it and crashes

 

what I did was rename chrome from the VM.. i dont need it that much in the meantime :) and now everything works

Link to comment
On 22/09/2016 at 0:24 AM, obazavil said:

Ok.. found a workaround.

 

Seems the index searches here also (when using spotlight or alfred):

/Users/obazavil/Applications (Parallels)/

 

And puts the stuff from that folder before the native chrome

 

so... i suppose rbt searches for the first chrome result, finds the parallel one, try to interact with it and crashes

 

what I did was rename chrome from the VM.. i dont need it that much in the meantime :) and now everything works

Now THAT is an interesting one... I will have a think and see if I can figure out a way to exclude the Parallels folder from the searches. Thank you for the info (that will make life a lot easier).

Link to comment
  • 3 months later...

This WF sound very useful but I can't get it to work.

* OSX = 10.11.6 (15G1212)

* Chrome = Version 55.0.2883.95 (64-bit)

* Alfred = Alfred 3.2.1, Build 768

* Config on Dropbox

 

I tried to turn on the debugger, but I don't see any output... the configuration steps were done and I can see that the dropbox stuff is used.

 

Any idea how to proceed?

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...