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

Share this post


Link to post

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.

Share this post


Link to post

Hi CarlosNZ,

 

See if the change I made is like you were thinking. It now has a new command that is actived by hotkey also. With it, you select which massager to perform and it will perform it. Give it a try.

 

Richard

Share this post


Link to post

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.

Share this post


Link to post

I just pushed the latest version to the GitHub account. Since I am using builtin PHP functions, the limitations are based on those functions. I believe those functions do not handle quotes correctly. I would have to research that one. Live preview works, but does slow down the script.

Share this post


Link to post

Hi, I just pushed a fix to the workflow. It now has a list that does not show the results for slower systems. I also fixed some bugs with the massagers in the list view. Give it a try and let me know if there are more massagers needed. Thanks for everyone's feedback.

Share this post


Link to post

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?

Share this post


Link to post

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.

Share this post


Link to post

Thank you for the explanation. No, I don't know of any such library function. Well, I still have good use for the workflow for all English writing, so thank you again.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...