Jump to content

How to create a TextBuddy Workflow?


Recommended Posts

Like @andy4222, I'm a big fan of TextBuddy. I would like to be able to select some text, invoke Alfred's Universal Actions, then choose from the menu of available options supported by TextBuddy.

 

More details: like many apps, TextBuddy has its own simply command palette: 

804917355_2021-11-29(13_58.02)GoogleChrome.thumb.png.5b0b1a73696343409965ccba7c8ea1a9.png

I've been in touch w/ the developer and we're interested in hooking up Alfred Universal Actions to these actions (e.g. having TextBuddy do the processing, possibly headlessly). 

 

@dfay's CaseConverter Workflow offers Text Actions:

 

image.thumb.png.05a3d9bb53d96b1134bc8726238c036a.png

...which implies that a TextBuddy Workflow would need to enumerate all of its Text Actions in order for Alfred to list them:

 

image.thumb.png.263eb51c35ed94df08192a066adacb80.png

 

— but I'm presuming that there might be a way for TextBuddy to generate a JSON List Filter or something like that would automate and keep-up-to-date that list of commands as they evolve in each app update.

 

My question is really to support Tyler building a deeper integration with Alfred. Are there tips or best practices for app devs to advertise their services to Alfred's UA engine? 

 

Thanks!

 

Link to comment

@Chris Messina Thanks for posting this. If Alfred team can steer this somewhere, that would be super slick!!

Either way, I was trying to integrate Alfred with TextBuddy. I have built this workflow with direction/help from @deanishe. It works with Alfred, not exactly like we want, but really close. It has two options:

 

- When we trigger Alfred UA, it shows TextBuddy option, and Enter-ing it would launch TextBuddy's command palette. I know this does require us to first launch Alfred's UA, hit Enter on TextBuddy option, then search for the action inside TextBuddy, so its one extra Enter, rather than TextBuddy's actions showing up in UA, but still really close. (See screens below)

 

- In the second option, I basically hooked this directly with a keyboard shortcut (Option + T) for Process with TextBuddy and (Option + S), for Send with TextBuddy. So when you select a text and hit that key combo, it launches TextBuddy's command palette, which is actually less key strokes even if TextBuddy's option showed up in Alfred's UA. I'm using this all the time since it saves a few keystrokes and does exactly what I want.

 

The best part about this is that it works for all apps, even the ones which don't support Mac Services, e.g. Obsidian. If you select text in Obsidian, and launch this workflow, it does exactly what we want, even though Obsidian doesn't even have a Services menu. Same goes for all other apps.

 

Credits to @vitor for sharing @deanishe workflow, I re-used & modified that workflow to build this.

 

Workflow: https://www.dropbox.com/s/l8xf8zat7cjhrj3/Text Transformer - TextBuddy.alfredworkflow?dl=0

 

1619805737_ScreenShot2021-11-29at11_44_56PM.thumb.png.b3f6abe573e35bd72cdf2fc5af49a4df.png

Edited by andy4222
Link to comment
10 hours ago, Chris Messina said:

I'm presuming that there might be a way for TextBuddy to generate a JSON List Filter or something like that would automate and keep-up-to-date that list of commands as they evolve in each app update.

 

It could create a workflow programmatically that contains a Universal Action for each of its transformations. That's how Dash's Alfred integration works. When you update your Dash configuration, it regenerates the workflow.

Link to comment
15 hours ago, andy4222 said:

@deanishe Can you please direct us to any docs and examples of how to programmatically create a workflows with UA?

 

If you check out Dash's workflow, it cleverly uses callbacks, and otherwise dynamically generates the plists for the Script Filters. 

 

open -g "dash-workflow-callback://{query}"

 

It does seem like this could be a good model to emulate!

Link to comment
  • 4 months later...

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...