Jump to content

Google Chrome Tab Search (Workflow)


Recommended Posts

Noticed a bug: if there are double quotes in a tab's title, the workflow returns no results. I think you can just use `quoted form of (title of theTab)` within the JSON string, and it should add double quotes around it and escape any double quotes within.

 

Also, you might have noticed that if you try to focus a tab that's in a background window, it won't fully bring that window to the foreground (the titlebar is grayed out, and it doesn't respond to keyboard events). You can use AXRaise to fix that. Here's the code I used in my "Search Browser Tabs" workflow:

 

tell application "System Events" to tell process "Google Chrome"
    perform action "AXRaise" of window 1
end tell

 

Just add that code to the end of the AppleScript, and it should properly focus the window.

Link to comment

I forgot to mention that AXRaise only works if "Enable access for assistive devices" is checked in the Accessibility preference pane. Otherwise you'll just get the same behavior as before (the window will be moved to the front, but won't be fully focused). Not sure how to get around that (other than prompting the user to enable that setting).

Link to comment

Managed to make it work, but seems redundant. Easier to search for a tab, go to it and close it?

 

It could be usable for managing your tabs via Alfred if after hitting [enter] the list just refreshed with an updated search instead of Alfred disappearing.

Link to comment
  • 2 years later...

I downloaded the zip file from github. 

Created a .alfredworkflow file for the tabs workflow.

Installed it on Alfred.

Typed "tabs" in Alfred search bar and got the following error in the console log:

Starting debug for 'Chrome Tabs'

[ERROR: alfred.workflow.input.scriptfilter] Code 1: Traceback (most recent call last):
  File "get_tabs.py", line 3, in <module>
    from alfred_utils.feedback import Feedback
ImportError: No module named alfred_utils.feedback
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...