Title Case and Sentence Case

I can't get Title case and Sentence case Macro to work properly. Any help would be appreciated.

Error Message

These both require you to select what you want to change, which will enable the Copy menu item under Edit. The error messages suggest there is no current selection in the text.

What can i do to make it get content from the clipboard instead of select.

Look in the Execute Shell Script action of each macro and change:

$_ = $ENV{KMVAR_localText};

to

$_ = `pbpaste`;

Delete the actions Copy and Set Variable above the Execute Shell Script action.

Here's Title Case for you:
Title Case Clipboard.kmmacros (7.5 KB)

That changes case on the Clipboard but leaves the text there.

I can't get the Sentence case to work even after replacing $_ = $ENV{KMVAR_localText}; to $_ = pbpaste;

Sentence Case.kmmacros (2.8 KB)

It doesn't look like you've made the change in precisely the right way. Those backticks (`) around pbpaste are necessary for Perl to run a system command.

1 Like

I think i got it to work finally. Thanks for the help.

Here's what i got
Title Case and Sentence Case.kmmacros (7.5 KB)

1 Like

Well done!