dfay 178 Posted April 24, 2013 (edited) Updated August 24, 2018 This is now a single workflow -- there are hotkeys for the following five actions: Uppercase Lowercase Capitalize - capitalizes all words (e.g. Posting A New Topic In Share Your Workflows) Title Case - capitalizes word except for "the", "in", "of" etc. according to American English title conventions (e.g. Posting a New Topic in Share Your Workflows) Sentence Case - capitalizes only the first letter of the first word & converts the rest to lower case All of these are set to Copy to Clipboard and Paste by default. There's also a script filter cc which lets you view the query converted and select your choice (like the Code Case workflow). You can also connect a hot key directly to the cc script filter directly to view the output options without typing the cc command and pasting your text. Download: https://www.dropbox.com/s/3k2lh21g5wnqrkp/Case Converter 2.alfredworkflow?dl=0 2018-02-09: updated link and updated workflow with fix to python workflow library The old version is described below and still available, if anyone prefers it. Workflow Version: This workflow converts the case of the text on the clipboard. http://dfay.fastmail.fm/alfred/Case%20Converter.alfredworkflow There are two workflows which display the following five options: Uppercase Lowercase Capitalize - capitalizes all words (e.g. Posting A New Topic In Share Your Workflows) Title Case - capitalizes word except for "the", "in", "of" etc. according to American English title conventions (e.g. Posting a New Topic in Share Your Workflows) Sentence Case - capitalizes only the first letter of the first word & converts the rest to lower case The keyword case will transform the text on the clipboard without pasting the result. The keyword casep will transform the text on the clipboard and paste (using Applescript System Events) Hotkey Version: Here is a version for use with hotkeys which will operate on the active selection in OS X and paste it with the converted text. These all have a half second delay prior to pasting, which is necessary for Applescript to be able to paste. http://dfay.fastmail.fm/alfred/Case%20Hotkeys.alfredworkflow Notes and Revision History: These use the Title Case perl script found at https://raw.github.com/ap/titlecase/master/titlecase . If you manage academic citations with BibDesk, Zotero, Papers, Mendeley, etc., Title Case conversion is especially useful for cleaning up downloaded citations. Updated May 3, 2013 with nicer colored icon thanks to mjv ( http://www.alfredforum.com/user/4384-mjv/ ) Updated February 5, 2014 to handle Sentence Case and to add a second keyword to paste after conversion. Updated May 20, 2014 with hotkeys Edited August 24, 2018 by dfay update re cc hotkey 9 1 nikivi, _mk_, shadylane and 7 others reacted to this Quote Share this post Link to post
nickvitale 1 Posted April 30, 2013 This is awesome! I have searched high and low for an easy way to do this. Applescripts, Alfred workflows, clipboard tricks, macros, entire applications, dashboard tools, Apple services, workflows, ... I think I made my point. I just wanted something easy. This is it. You have, literally, solved a multi-year search for a simple way to convert text to different cases. Also.. I'm not a coder, programmer or anything else so even if I found that github installation, I'd fail to make it work. Thank you again! Quote Share this post Link to post
dfay 178 Posted April 30, 2013 Thanks! I was in the same situation - I had Services, BibDesk applescript, OnMyCommand commands, etc. but a lot of them were context-specific and in locations that didn't sync from one computer to another, so an Alfred workflow seemed like the perfect way to put it all in one place. Quote Share this post Link to post
yoose 1 Posted May 1, 2013 Thanks, this is really useful! Since you guys mentioned that you were looking for other methods, there is an app that has the similar functionality through an extension, Popclip http://pilotmoon.com/popclip/ It is pretty convenient as it is automatically appears, iOS style, if you use your keyboard to select text and do not want to use the mouse, you can easily create a hotkey to have alfred make the menu appear, which is what I have done. Quote Share this post Link to post
nickvitale 1 Posted May 2, 2013 Thanks, this is really useful! Since you guys mentioned that you were looking for other methods, there is an app that has the similar functionality through an extension, Popclip http://pilotmoon.com/popclip/ It is pretty convenient as it is automatically appears, iOS style, if you use your keyboard to select text and do not want to use the mouse, you can easily create a hotkey to have alfred make the menu appear, which is what I have done. In fact I have this app. I like it. At home on my Retina it's no problem to have running 24/7 but at work I have to count every, single, megabyte of RAM used and I have to use it carefully. Also, Popclip costs something, something that should cost nothing considering the 'power' a Mac has, even in Applescript, it's astounding that there isn't one really good service or script for something like this. Running an entire app, though filled with other features, is a bit crazy for this single feature. However, I take your point. It's definitely a valid solution, especially for either casual users or people that have enough RAM to validate the use of. I have used it, at home, and it has a lot of great plugins that offer a big increase in functionality like the Evernote integration. Thanks Quote Share this post Link to post
yoose 1 Posted May 3, 2013 In fact I have this app. I like it. At home on my Retina it's no problem to have running 24/7 but at work I have to count every, single, megabyte of RAM used and I have to use it carefully. Also, Popclip costs something, something that should cost nothing considering the 'power' a Mac has, even in Applescript, it's astounding that there isn't one really good service or script for something like this. Running an entire app, though filled with other features, is a bit crazy for this single feature. However, I take your point. It's definitely a valid solution, especially for either casual users or people that have enough RAM to validate the use of. I have used it, at home, and it has a lot of great plugins that offer a big increase in functionality like the Evernote integration. Thanks I agree it is a great little program and has great plugins, cant wait to see what else comes up. I also feel like it should be in OS X seeing as how its inspired by iOS, but am grateful that it is not too expensive. Quote Share this post Link to post
kithairon 3 Posted May 22, 2013 Very sweet. Thanks for this! Use it with my bibliography tool. 1 dfay reacted to this Quote Share this post Link to post
Davide 9 Posted July 1, 2013 Thanks for this also! Is it possible to get it work also with special charakters like the Germans ä, ö, ü, ß? Quote Share this post Link to post
dfay 178 Posted July 1, 2013 I've looked quickly at some options using Perl and Python (as well as bash tr , the existing approach) & none of them have worked for me....I'm not an expert in either though. http://ubuntuforums.org/showthread.php?t=1054470 http://bioinfo2.ugr.es/documentation/Perl_Cookbook/ch01_10.htm Both of these work for unaccented characters, but not for accented. If you can find a script that works, hooking it into the workflow should be trivial. Quote Share this post Link to post
iNyar 0 Posted October 17, 2013 Hi, Great workflow, really ! It's great to have this. Thanks a lot. Only a small suggestion: I'd like a 5th option : Sentence Case : only the first letter of the sentence would be capitalized (useful especially for French titles, which only use a capital on the first word). Quote Share this post Link to post
MxmHrpr 0 Posted January 22, 2014 Hi, Great workflow, really ! It's great to have this. Thanks a lot. Only a small suggestion: I'd like a 5th option : Sentence Case : only the first letter of the sentence would be capitalized (useful especially for French titles, which only use a capital on the first word). +1 on this addition, especially useful when my lecturer has his powerpoints in solid caps... Quote Share this post Link to post
juanpazos 1 Posted January 23, 2014 How do I make the text, after converted, be automatically pasted on where the cursor is (without the need of pressing Cmd+V)? Thanks Quote Share this post Link to post
juanpazos 1 Posted January 23, 2014 One more thing: accentuated caracters (like "á", "ó", "ã" , "ç") don't get converted at all. The bastards stay the same. Is there a fix for that? Quote Share this post Link to post
dfay 178 Posted February 8, 2014 Updated February 5, 2014 to handle Sentence Case and to add a second keyword to paste after conversion. On accented characters, see my post of 7/1/2013. Cheers Derick Quote Share this post Link to post
Davide 9 Posted February 11, 2014 (edited) Devon offers an plugin called WordService, it works also with special characters. Edited February 11, 2014 by Davide Quote Share this post Link to post
dfay 178 Posted May 21, 2014 Updated to add a version set up for use with hotkeys. 1 thec13 reacted to this Quote Share this post Link to post
deanishe 1,072 Posted June 6, 2014 I've looked quickly at some options using Perl and Python (as well as bash tr , the existing approach) & none of them have worked for me....I'm not an expert in either though. http://ubuntuforums.org/showthread.php?t=1054470 http://bioinfo2.ugr.es/documentation/Perl_Cookbook/ch01_10.htm Both of these work for unaccented characters, but not for accented. If you can find a script that works, hooking it into the workflow should be trivial. Python works perfectly, but only with Unicode, not encoded strings: print('UTF-8 strings\n') for s in ['über außer', 'öffnungszeiten für morgen']: print(s.title()) print(s.upper()) print('\nUnicode\n') for s in [u'über außer', u'öffnungszeiten für morgen']: print(s.title()) print(s.upper()) outputs: UTF-8 strings üBer AußEr üBER AUßER öFfnungszeiten FüR Morgen öFFNUNGSZEITEN FüR MORGEN Unicode Über Außer ÜBER AUßER Öffnungszeiten Für Morgen ÖFFNUNGSZEITEN FÜR MORGEN Quote Share this post Link to post
PhilosopherDog 0 Posted August 26, 2014 (edited) Hi, do you have a link to the May version? I only see the latest link to the Feb version. BTW, nice workflow! Thanx. Edited August 26, 2014 by PhilosopherDog Quote Share this post Link to post
patrickmcd 0 Posted August 27, 2014 Awesome. But I'm here to beg for more. All the options here would be nice: titlecase.com Camel, Pascal, Hyphen, and Snake would be great additions for coders, camelCase being the reason I searched for a workflow. Quote Share this post Link to post
dfay 178 Posted August 28, 2014 Hi, do you have a link to the May version? I only see the latest link to the Feb version. BTW, nice workflow! Thanx. It's there - it's the second link in the post - I've updated the initial post to make it clearer that there are two different download links. Quote Share this post Link to post
dfay 178 Posted August 28, 2014 @patrickmcd I'll do this in a separate workflow Quote Share this post Link to post
mixterdee 15 Posted September 2, 2014 Great little workflow and very useful for me, something I will use many times a day. Thanks Quote Share this post Link to post