Functionality of Text Case

There’s a clever iOS app called Text Case. As you input text into any app, you can copy text to clipboard, and call up Text Case via the Share function, and have it trim white space, convert to lower/upper/title case, strip HTML, format a Markdown Blockquote, etc etc. Text Case copies the converted text so you can paste it back into its original context, replacing the highlighted text.

I know Drafts is supposed to work the other way - as a platform to compose text for use elsewhere. But is there any functionality for sharing text from some other app back to Drafts for transformation, ala Text Case? If so, I could replace Text Case…and add my own transformations.

Take a look at the “Run Action with Text” Drafts action in Shortcuts. Create your share sheet enabled shortcut and off you go.

Thanks! (looks like I’m finally going to need to digest the MacSparky Field Guide on Shortcuts, because I’m lost even after reading this doc).

Fwiw I see there’s some good guidance on “Run Action With Text” in this thread, too.

Hmm. I want this functionality on Desktop, too.

So I guess the way to go is, having created Shortcuts linked to “Run Action with Text” for Drafts mobile, I’d also create search/replace applescripts (I don’t do JS), and pack them into individual text-transforming Drafts actions for use on desktop-only?

Edited Update
Drafts seems finicky about search/replace applescripts. For starters, the app is surprisingly not compatible with Recording in Script Editor (which would help users learn syntax). And simple scripted search/replaces that work great with BBedit don’t work in Drafts, so there must be a different syntax requirement. And after 30 mins of searching this site, I see no references to non-RegEx searching, which would remove the complexity of escaping for newbie scripting efforts.

If there’s a way to build an action to do a simple search/replace action, it’s not evident, and IMO that should be an installed default action (which users could then play with to suit their needs).

It might also be newbie-friendly to add a “Script this search/replace action” button to Draft’s find/replace window.

For what it’s worth, I would guess that many, if not all of the most useful text conversion cases already exist in the action directory and would utilise JavaScript so you wouldn’t necessarily have to write anything at all to have cross platform actions.

[quote=“sylumer, post:5, topic:8493”]
many, if not all of the most useful text conversion cases already exist in the action directory[/quote]

I must have chosen the wrong search terms to try to find them. Directory search seems somewhat stingy … title only. “Search Replace” returns no items found. Ok, I’ll go browse more closely, thanks

FWIW, I added an "edited update to my previous posting just as you replied. But great that there are lots of pre-configured simple search/replace actions out there I can crib from.

There is only very limited support for controlling Drafts from AppleScript right now. Greg has promised more support but not given any dates for when more will come.

Ah, ok.

I, alas, am in the small group not nerdy enough for JS but who still want to use Drafts like a geek.

1 Like