Skip to Content

Change Case uses OS X Services to expand TextEdit

Mac OS X Services have been around for a while, but not many people use them. Under the title of any Cocoa program in the upper left of the menu bar, you'll find an option for Services. This brings up a pull-down menu of services that are appropriate to the program at hand. They can be a real time saver.

I use TextEdit for writing my TUAW posts, and it's always running. Recently, I found a neat service that works wonders for TextEdit and (I'm sure) a bunch of other text editors. It's free for the downloading from Ron Fleckner in Melbourne, Australia. What you'll get is a ZIP file that expands into a little, 86KB application file called Change Case.

Once installed, select some words or sentences, go to Services, and you'll get a screen like the one above. It's pretty self explanatory; ALL CAPS, All lowercase, and Toggle Case do just what they say. Word Capitals capitalizes each word in a sentence, and camelCase (which you might know as InterCap) is mostly used for brand names. It turns something like " My Program" into "MyProgram." While it's true that a few of these options are available in TextEdit under the Edit-> Transformations menu (namely: Make Upper Case, Make Lower Case and Capitalize), the Services menu is easier to get to, and Change Case does more.

I had a bit of trouble with it, which was probably all my fault. I've been emailing Ron, who has given me a great deal of insight as to what's happening. The first thing that may be a bit confusing is Ron's graphic, which looks like this:
Note: Since this writing, a Snow Leopard picture has been added to Ron's site.

The hierarchical menu that's shown only appears if you are running OS X 10.5 (Leopard). Apple did away with this useful feature in OS X 10.6, so Snow Leopard users will see the first picture in this post. Some other things were also broken. Under Snow Leopard, you won't find the old "New TextEdit Window Containing Selection" or "Open Selected File in TextEdit." That's in spite of the fact that TextEdit's info.plist file, where applications advertise Services to the Finder and System, have the correct entries (go figure).

Ron's page says to install the Change Case app in the root /System/Library folder, but as it turns out, that really isn't necessary. Finder will look for Services files anywhere. It is a good idea to follow his advice, though, if only to keep your Services in one place and make it easier to find. When you move it, you might get the usual 'type in your password" screen, or sometimes this comes up:
Don't believe it. Just click on Authenticate, and the usual "enter your password" screen will come up. Next, you need to log out and log back in so that the Finder will recognize it . Once that's done, you'll need to go to System Preferences and choose the Keyboard Preference pane. From there, click on "Keyboard Shortcuts," and you'll get a screen that looks like this:
As shown above, select Services and check the Change Case items. Close the pane, and you're ready to go.

I had some trouble getting it to work on my MacBook Pro, but following these instructions worked perfectly on my iMac, so I'm pretty sure that the screw-ups were all mine. Just in case they weren't, though, here's what happened on the MacBook Pro (and how I solved the problems). The first time that I moved the file to the root /System/Library folder and logged out and back in, I found the entire folder to be empty. All the Services were gone. This was easily solved by copying the contents of the folder from my iMac onto a flash drive and copying it back to the MacBook Pro. Just to be on the safe side, you might want to copy the folder to your desktop and archive it into a ZIP file, which will give you easy recourse if this happens to you.

I deleted Change Case but didn't empty the trash, so there was at least one extra copy of it (and maybe more, since I went through installation a few times) still on my system. After logging out and back in, I went to the Services menu, which simply said "Building." I waited for a little while, and nothing ever showed up as Services (in any program). According to Ron, this was probably caused by the fact that I had more than one copy of Change Case on the MacBook Pro; the multiple copies were confusing the Finder. So, I found every instance of Change Case, made sure they were deleted, and I emptied the trash. Next, I downloaded a fresh copy of Change Case, unzipped it, moved it to the /System/Library folder, logged out and back in, enabled it via the Keyboard Preference Pane, and it worked like a champ.

Again, this probably won't happen to you. Change Case is only a few lines of code, and according to Ron, it doesn't mess with anything important in the System or Finder, but it's better to be safe than sorry.

Those familiar with Xcode or AppleScript will probably find it useful to roll their own services. If you do, Ron recommends leaving the new Services in the place where Xcode puts them, which is in a folder called "build" (in the projects folder). That way, any new version will overwrite the old one, and you won't have to worry about removing it.

[via creativebits]


Categories

Software

Mac OS X Services have been around for a while, but not many people use them. Under the title of any Cocoa program in the upper left of...
 

Add a Comment

*0 / 3000 Character Maximum

12 Comments

Filter by:
nebmot

If you open textedit, click edit go to transformation, this functionality is already built in.

it works for mail too.

August 13 2010 at 9:36 PM Report abuse rate up rate down Reply
Edward Eslami

What I would like is a smart capitalization routine. One that capitalizes like the Word Capitals but ignores: the, an, a of, etc. except at the beginning of the sentence.

Example: The Apples are Full of Good Vitamins.

Why hasn't anyone done this yet? It would save a lot of time...

August 13 2010 at 3:45 PM Report abuse rate up rate down Reply
2 replies to Edward Eslami's comment
ilkyone

there's ninety million takes on Title case scripts, here's a good place to start: http://daringfireball.net/2008/05/title_case

August 13 2010 at 5:45 PM Report abuse rate up rate down Reply
mailto:tuaw

Thanks for the info... I messed around with it, but could not get it to work under Snow Leopard, but you helped me find textsoap, which does smart capitalization and allows you to build exception lists. it is pretty nice! thanks again for the help...

August 15 2010 at 1:50 AM Report abuse rate up rate down Reply
FoxyOrb

When using TextEdit, 3 of these are incorporated in Edit > Transformation menu: Make Uppercase, Make LowerCase, Capitalize.
@ilkyone thank you for the info on Devon's WordService

August 13 2010 at 3:00 PM Report abuse rate up rate down Reply
John.B

Trust me on this: ALL CAPS is not needed...

August 13 2010 at 2:20 PM Report abuse rate up rate down Reply
Ken Cohen

I also recommend what ilkyone says about DevonThink's service items, some of which are in my QK toolbars mentioned in my last comment.

I also should have said, for those not familiar with Quickeys, that once the toolbars are set up, all you need to do to use a service is click its toolbar entry.

August 13 2010 at 11:00 AM Report abuse rate up rate down Reply
Ken Cohen

Services can be a real problem because there are so many of them available and they're hidden away so that I forget about them.

I fixed this using Quickeys X 4.0, which is one of my all-time favourite Mac utilities dating back at least 20 years. It's simple to do. Create a Quickeys menu shortcut for each Services item you think you'll want to use. Create one or more Quickeys toolbars and drag the shortcuts in their Toolbars. (I like to use separate toolbars for each application). Now I can't forget about the service items, as they're on-screen staring me in the face all day as I work.

August 13 2010 at 10:54 AM Report abuse rate up rate down Reply
ilkyone

similar to brian, I'm not trying to start a war here, either, but my services menu is heavily used, and the ones getting the most usage are from DEVONtechnologies and Bean (free).

Both offer word wrangling services for free.

DEVONtech's Word Services 2.7 is free here: http://www.devon-technologies.com/products/freeware/services.html and it does the bulk of heavy lifting, even including a statistics service that allows you to get a word count anywhere you are typing text, whether email, web form, etc...

all 34 services are:
Reformat, Remove line attachments/endings/links/multiple spaces/multiple feeds/quotes, Trim line beginnings/line endings/lines, Sort lines ascending/descending, Shift left/right, Initial caps of words/sentences, All caps and lowercase, Mac/Windows/Unix line endings, Rotate 13, Straight/Smart Quotes, Encode/Decode tabs, Insert date/date and time/time/contents of path, Speak native/German text, Statistics.

check out the other freebies they give, too, including an RTF2PDF converter. These services and a bunch more are part of the DEVON suite, but they give these bits for free.

August 13 2010 at 10:32 AM Report abuse rate up rate down Reply
brian

Not trying to start an editor war here, just wanted to point out that TextWrangler (free) and BBEdit (not) have "Change case" in the "Text" menu. Options are: all upper case, all lower case, capitalize words, capitalize sentences, and capitalize lines.

August 13 2010 at 10:14 AM Report abuse rate up rate down Reply
1 reply to brian's comment
gorfgorf

And there's nothing in these services you couldn't do with a simple find and replace in TextWrangler if you turn on regular expressions.

August 13 2010 at 8:11 PM Report abuse rate up rate down Reply
Ivan Raszl

Thanks for the creativebits.org link!

August 13 2010 at 9:34 AM Report abuse rate up rate down Reply
Buy an ad here

Hot Apps on TUAW

Tweets

© 2012 AOL Inc. All Rights Reserved.