Page 1 of 2

Text modification - Changing cases

Posted: Mon Oct 26, 2009 11:05 pm
by ptujec
Since Snowleopard some of the service items are gone. You can still change transform text to upper or lower case with secondary click/transformations but ...
1) Thats not accessable through Launchbar because not a „real“ service but an extra category. …
2) I miss an option to capitalize only the first word of each sentence.

I couldn’t find anything good on the web …
Any ideas?

Re: Text modification - Changing cases

Posted: Tue Oct 27, 2009 11:28 am
by iRounak
you can try: http://u.nu/5zap3
Use system preferences>>keyboard and mouse>>keyboard to assign a keyboard shortcut.
or you can try UI scripting in applescript to click that item(item which changes case) in the Service Menu or wherever it is.
I don't use Snow Leopard, so I don't know where that item is.

Re: Text modification - Changing cases

Posted: Tue Oct 27, 2009 9:44 pm
by ptujec
iRounak wrote:you can try: http://u.nu/5zap3
Use system preferences>>keyboard and mouse>>keyboard to assign a keyboard shortcut.
or you can try UI scripting in applescript to click that item(item which changes case) in the Service Menu or wherever it is.
I don't use Snow Leopard, so I don't know where that item is.


It works with context menu but it doesn’t with LaunchBar unfortunately.

Re: Text modification - Changing cases

Posted: Wed Oct 28, 2009 6:08 am
by iRounak
It works with context menu but it doesn’t with LaunchBar unfortunately.

I did not understand you :? and apparently, you did not understand what i wrote either. :D Its better if an experienced LaunchBar user helps you. I have just switched from Quicksilver

Re: Text modification - Changing cases

Posted: Wed Oct 28, 2009 9:28 am
by ptujec
iRounak wrote:
It works with context menu but it doesn’t with LaunchBar unfortunately.

I did not understand you :? and apparently, you did not understand what i wrote either. :D Its better if an experienced LaunchBar user helps you. I have just switched from Quicksilver


No no, your suggestion helped. Its even accessible through LaunchBar but it wouldn’t do the job when used with LaunchBar. Maybe thats due to the changes which had to be done on LaunchBar because Services changed in Snowleopard.

Re: Text modification - Changing cases

Posted: Sat Oct 31, 2009 12:36 pm
by norbert
ptujec wrote:Since Snowleopard some of the service items are gone. You can still change transform text to upper or lower case with secondary click/transformations but ...
1) Thats not accessable through Launchbar because not a „real“ service but an extra category. …
2) I miss an option to capitalize only the first word of each sentence.

I couldn’t find anything good on the web …
Any ideas?

You might try WordService from DEVON:
http://www.devon-technologies.com/download/

It's free and it provides a whole bunch of useful services, including case conversions like:

  • All Caps
  • Lowercase
  • Initial Caps Of Sentences
  • Initial Caps Of Words

Re: Text modification - Changing cases

Posted: Sat Oct 31, 2009 1:31 pm
by iRounak
You might try WordService from DEVON:
http://www.devon-technologies.com/download/

I also pointed to WordService when I gave my shortened url earlier :D

Re: Text modification - Changing cases

Posted: Sat Oct 31, 2009 1:33 pm
by ptujec
norbert wrote:
ptujec wrote:Since Snowleopard some of the service items are gone. You can still change transform text to upper or lower case with secondary click/transformations but ...
1) Thats not accessable through Launchbar because not a „real“ service but an extra category. …
2) I miss an option to capitalize only the first word of each sentence.

I couldn’t find anything good on the web …
Any ideas?

You might try WordService from DEVON:
http://www.devon-technologies.com/download/

It's free and it provides a whole bunch of useful services, including case conversions like:

  • All Caps
  • Lowercase
  • Initial Caps Of Sentences
  • Initial Caps Of Words


Thx. Thats what iRounak suggested. It works but not within LaunchBar.

Re: Text modification - Changing cases

Posted: Sat Oct 31, 2009 1:42 pm
by norbert
iRounak wrote:I also pointed to WordService when I gave my shortened url earlier :D

Ah, I didn't follow the the shortened link, so I didn't realize that it links to WordService.

Re: Text modification - Changing cases

Posted: Sat Oct 31, 2009 1:47 pm
by norbert
ptujec wrote:Thats what iRounak suggested. It works but not within LaunchBar.

I see, you are probably running a non-English system, do you? There's a bug in our current services implementation, causing localized services to fail. This will be fixed in 5.0.2.

Re: Text modification - Changing cases

Posted: Sat Oct 31, 2009 2:04 pm
by ptujec
norbert wrote:
ptujec wrote:Thats what iRounak suggested. It works but not within LaunchBar.

I see, you are probably running a non-English system, do you? There's a bug in our current services implementation, causing localized services to fail. This will be fixed in 5.0.2.


Good to hear!

Re: Text modification - Changing cases

Posted: Sat Oct 31, 2009 2:41 pm
by sjk
norbert wrote:
iRounak wrote:I also pointed to WordService when I gave my shortened url earlier :D

Ah, I didn't follow the the shortened link, so I didn't realize that it links to WordService.

I'd rather people didn't use URL shortening on forums because it obfuscates the target.

Edit: fixed missing "on" typo.

Re: Text modification - Changing cases

Posted: Sat Oct 31, 2009 6:33 pm
by norbert
ptujec wrote:I'd rather people didn't use URL shortening forums because it obfuscates the target.

Me too. I'd recommend to use named URLs instead. Example:

Code: Select all

[url=http://www.example.com/some/very/long/address/]Name of Target[/url]

Re: Text modification - Changing cases

Posted: Sat Oct 31, 2009 8:23 pm
by sjk
TinyURL links are tolerable with the preview feature enabled. Directly opening unknown targets with other URL shortening services bothers me.

Re: Text modification - Changing cases

Posted: Sun Nov 01, 2009 6:32 am
by iRounak
To ptujec:

It seems you know some applescripting (looking at your other posts)
so modify this to suit your needs:

Code: Select all

on handle_string(theString)
   ...................................................
tell application "LaunchBar"
perform action "Copy and Paste" with string sometext
hide
end handle_string
on change_case_of(this_text, this_case)
   if this_case is "mixed" then return mixedCase(this_text)
   if this_case is "lower" then
      set the comparison_string to "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
      set the source_string to "abcdefghijklmnopqrstuvwxyz"
   else
      set the comparison_string to "abcdefghijklmnopqrstuvwxyz"
      set the source_string to "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
   end if
   set the new_text to ""
   repeat with thisChar in this_text
      set x to the offset of thisChar in the comparison_string
      if x is not 0 then
         set the new_text to (the new_text & character x of the source_string) as string
      else
         set the new_text to (the new_text & thisChar) as string
      end if
   end repeat
   return the new_text
end change_case_of
to mixedCase(theText)
   set newText to {}
   repeat with myWord in (every word of theText)
      set end of newText to (change_case_of(first character of myWord, "upper") & change_case_of(rest of characters of myWord, "lower"))
   end repeat
   return newText as string
end mixedCase


If you can't make sense of the above script. Find the original script here: http://u.nu/52tq3
Its in the "Editing" folder.
(To others: I like to use URL shortening and its all scripted and a part of my workflow. And tinyurl is not tiny enough)