gillibrand / alfred-change-case

An Alfred workflow to change the case of text on the clipboard.
114 stars 12 forks source link

Sentence Case #5

Open christianmagill opened 4 years ago

christianmagill commented 4 years ago

Would be nice to have a sentence case option. Often I am using the extension for quickly correcting text that has been typed in all caps.

Artform commented 3 years ago

My Solution for this:

  1. Right click on plugin and "Open in Finder"
  2. Open the changecase.py file in any editor you want (ie. VS Code)
  3. Add the following to it... then save and test

Line 36: 'sentence': escape(text[0].upper() + text[1:].lower(), {'"': '"', '\n': '
'} ) Line 72:

  <item arg="%(sentence)s">
    <title>"%(sentence)s"</title>
    <subtitle>Transform text to `Sentence case`</subtitle>
    <icon>camelcase.png</icon>
  </item>

Shout out to @jdavisclark for his Alfred plugin, which I used the solution for line 36.

rachelcsimmons commented 3 years ago

Hi there, I'm sorry, I'm new to editing alfred workflows. I followed a guide that said if you want to edit the contents of a .alfredworkflow file, you change the extension to .zip and unzip it. That worked and i was able to find the .py file and make the edits suggested above. However, the guide said to zip the folder again and then change .zip back to .alfredworkflow, and I did that, but when I imported to Alfred, it said Error, "The workflow you are trying to import is invalid."