Jump to content

Recommended Posts

I am often changing text around to different formats in large quantities. So, I made a workflow for keeping all of them. I call it text massagers because you are "massaging" the text with the script. You can use this as your template for your own massagers. All of these scripts takes the item from the clipboard, massages it, and places back into the clipboard while showing you the results.
 
<alt><command>m  - Expects a markdown anchor line in the clipboard
                   and converts it to a HTML anchor within a list
                   item.
 
<alt><command>o  - Changes the "streaming=off" to "streaming=on" in
                   a WordPress shortcode in the clipboard.
 
<alt><command>t  - Fixes a time into HH:MM:SS format no matter what
                   it was before.
 
<shift><command>” - Takes the current selection and passes it to the “tm:select” command for selecting the text massager from a list. It will show the result of the massager in the list. It will then perform the selected “massage” to the text, and copy it to the clipboard and back into the document it was grabbed from if possible.
 
<shift><alt>” - Takes the current selection and passes it to the “tm:select” command for selecting the text massager from a list. It will not show the result of the massager in the list. It will then perform the selected “massage” to the text, and copy it to the clipboard and back into the document it was grabbed from if possible.
 
 

Download: https://github.com/raguay/MyAlfred

Edited by raguay.customct
Link to comment
  • 1 year later...

This is a great idea, although I'd suggest you add a keyword with a script filter list of conversions, as all those hotkeys are going to get unwieldy once the list of available transformations grows.

 

Speaking of which, I'd love to see a "case conversion" transformation. There's at least six options there that I can think of:

  1. CONVERT ALL TO UPPER
  2. convert all to lower
  3. Capitilize Words
  4. Capitalize sentences
  5. Capitalize lines
  6. Convert to Title Case

Maybe this wasn't what you had in mind, and you don't want it getting unwieldy. Although, I was thinking of building a case conversion workflow of my own, but if you were going to add it to this then I won't bother. Up to you.

 

Carl.

Link to comment

Very nice. B)

 

It seems to choke on certain characters though. In particular, the smart quotes “” & ‘’ are the first ones I've found -- the output is just the same as the input in that case.

 

Also -- one small aesthetic suggestion: make the result subtext (current just says "Text Massager") give a preview of the transformed text. That'd be pretty cool.

 

Great work though. Thanks a lot.

Link to comment
  • 2 years later...

I find this workflow very useful, thank you for making it. It hasn't been fully reliable for me, but right now I seem to be unable to reproduce when it's failing. One problem that I can reproduce however is that when I select text which has any of the Swedish characters å, ä, or ö the only available option shown by the workflow is "Make Upper Case" (which works). This limits the usability somewhat for me, any chance this can be fixed?

Link to comment

Hi,

 

If you use the option tm:selectn, it will show each of the types of converting the text. But, I believe the result isn't what you want. The problem is the PHP library function I am using doesn't handle non-English letters. The library was designed specifically for English only. If you know of a library that works for Swedish, I would make a version for you. I haven't found one myself, yet.  Sorry for the inconvenience.

Link to comment
  • 2 weeks 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...