Jump to content

Is there a way to integrate Bartender 4 with Alfred?


Recommended Posts

Bartender 4 supports AppleScript and, in very crude terms, you could include something like this in a workflow to trigger the Bartender quick search window:

 

tell application "Bartender 4"
    quick search
end tell

 

That is pretty basic but it may give you enough of an idea to develop something better!

 

Stephen

Link to comment

With just a little more detail:

 

Set up a workflow with "Run Script" action, choosing:

 

Language: /usr/bin/osascript (AppleScript)

"with input as {query}"

running instances "Sequentially"

script:

 

tell application "Bartender 4"
    quick search with "{query}"
end tell

 

I hooked mine up to a Keyword action with keyword: "bar"

 

 

Link to comment
  • 1 year later...
On 7/15/2022 at 9:08 PM, Stephen_C said:

Bartender 4 supports AppleScript and, in very crude terms, you could include something like this in a workflow to trigger the Bartender quick search window:

 

tell application "Bartender 4"
    quick search
end tell


To make it work with Alfred 5 just change the application string:
 

tell application "Bartender 5"
    quick search with "{query}"
end tell

 

On 7/17/2022 at 5:55 PM, unlink said:

I put this into a workflow. You can find it on packal and github

PR with the update for Bartender 5 + optional query argument: https://github.com/BlkPingu/bartender-search/pull/3

Edited by Anthony Accioly
Link to comment
  • 2 weeks later...

Could someone please briefly explain which Workflow elements I'd use to run this script that @Anthony Accioly has kindly published?

 

I'm new to creating workflows in Alfred, so thanks in advance for your help. 

Ps. I've checked the Github docs and don't think the answer is there (I'm sure it's probably obvious for those more experienced 🙏 )

 

On 9/27/2023 at 6:52 PM, Anthony Accioly said:
tell application "Bartender 5"
    quick search with "{query}"
end tell

 

Link to comment

Always prefer with input as argv over with input as {query}. Plus, like Alfred, Bartender seems to change its name but keep the bundle identifier so use that instead for future-proofing. The code will be:


on run argv
  tell application id "com.surteesstudios.Bartender" to quick search with item 1 of argv
end run


That is untested, and based on the previous comments.

 

1 hour ago, Pelby said:

I'm new to creating workflows in Alfred

 

See the Getting Started Guide for an interactive tutorial on making workflows.

Link to comment

Purely as a matter of personal preference, for others reading this thread, I prefer a hotkey or keyword (with no argument or space) linked to this:

  tell application id "com.surteesstudios.Bartender" to quick search

 

Your hotkey or keyword then simply opens the Bartender quick search dialog (with the advantage you can immediately see a list of menu bar items and, if you wish, can search them).

 

I appreciate others may prefer the alternative, of course.

 

Edit: That applies only to Bartender 5, of course—which has the quick search dlalog.

 

Stephen

Edited by Stephen_C
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...