Jump to content

API for external applications to register workflows


alaroldai
 Share

Recommended Posts

I'd like the ability for external applications to add commands to Alfred. Many applications (e.g. Sublime Text / Atom) provide command-pallete like functionality that is very similar to Alfred, and the I keep finding myself reaching for one when I actually need the other - reaching for Alfred when trying to go to a file in Sublime Text for example. If ST were to register it's menu hierarchy with Alfred somehow, Alfred could keep track of the currently-focused application and surface it's menu bar or other options preferentially, providing an interface that would feel more deeply integrated with the whole OS.

Link to comment
Share on other sites

That's *very* close to what I mean, but has a couple of differences:

  • Requiring a keyword rather than having the menu options as default results
  • Results are limited by what is available in the menu bar. Some applications provide options that aren't visible in the menu bar (e.g. Build With... in Sublime Text).

An API for client programs to surface first-class results would provide a more integrated and flexible experience.

Link to comment
Share on other sites

Well the first of those issues can easily be fixed in that workflow by changing the argument to be optional, and editing main.rb (or better copying it and making a new script filter to call the edited version) with the lines

if (search_term.length > 0)
	puts MenuItems.generate_xml(search_term, MenuItems.generate_items())
end

replaced with 

if (search_term != "")
	puts MenuItems.generate_xml(search_term, MenuItems.generate_items())
else
	puts MenuItems.generate_xml("",MenuItems.generate_items())
end

 

 

The second issue would require third-party developers to make the commands discoverable to Alfred, which hardly seems likely especially since it's only to accommodate a few edge cases.  I'd think writing a workflow to read the Sublime Text palette commands directly might be a better solution.

Link to comment
Share on other sites

13 hours ago, alaroldai said:

An API for client programs to surface first-class results would provide a more integrated and flexible experience.

 

And would also require them to use it…

 

57 minutes ago, dfay said:

 

I'd think writing a workflow to read the Sublime Text palette commands directly might be a better solution.

 

If that's even possible, you'd need to start with a Sublime Text plugin. It's a non-native app with zero support for AppleScript etc. You'd have to export the data from Sublime because there's no way to access them from outside Sublime.

 

What's more, Alfred would be a fairly sucky replacement for Sublime's palette, as Sublime uses full fuzzy search and Alfred uses word-starts-with. Depending on the types of queries you use, Alfred is going to give you very different results to Sublime.

Link to comment
Share on other sites

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
 Share

×
×
  • Create New...