raguay.customct Posted April 5, 2013 Share Posted April 5, 2013 (edited) 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 April 18, 2014 by raguay.customct Link to comment
CarlosNZ Posted April 12, 2014 Share Posted April 12, 2014 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: CONVERT ALL TO UPPER convert all to lower Capitilize Words Capitalize sentences Capitalize lines 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
raguay.customct Posted April 12, 2014 Author Share Posted April 12, 2014 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 Link to comment
CarlosNZ Posted April 12, 2014 Share Posted April 12, 2014 Very nice. 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
raguay.customct Posted April 12, 2014 Author Share Posted April 12, 2014 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. Link to comment
raguay.customct Posted April 13, 2014 Author Share Posted April 13, 2014 Just fixed the Title Case to a function that does more than capitalize every word. It now goes through an exception list to not capitalize or change. Updated on Packal as well. Link to comment
CarlosNZ Posted April 14, 2014 Share Posted April 14, 2014 Live preview works, but does slow down the script. Yup, makes it unusably slow on my system I'm afraid. Link to comment
raguay.customct Posted April 18, 2014 Author Share Posted April 18, 2014 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. Link to comment
ctwise Posted April 18, 2014 Share Posted April 18, 2014 You might want to take a look at the funnel workflow as well. http://www.packal.org/workflow/funnel Link to comment
cands Posted July 15, 2016 Share Posted July 15, 2016 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
raguay.customct Posted July 18, 2016 Author Share Posted July 18, 2016 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
cands Posted July 26, 2016 Share Posted July 26, 2016 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. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now