Jump to content

Case Converter (including Title Case) - now working on MacOS 12.3


Recommended Posts

  • 7 months later...

Nice script.

 

My problem with it is, it requires too much focus to use. I can't invoke a particular keyword or hotkey because the order of the items (Upper Case, Lower Case, Title Case etc.) depends on what was the last used.

 

Is there any way to order them statically? Or even better, to invoke a different keyword for each, which reduces 3 steps (keyword + Cmd+number + paste) to 2 (keyword + paste).

Link to comment

To always have the actions in the same order, you need to edit the workflow so it doesn't give the actions UIDs.

 

The UID is how Alfred identifies actions and remembers what you selected in the past. Without UIDs, results are always shown in the same order they're emitted. 

Link to comment
On 12/27/2016 at 2:39 PM, deanishe said:

To always have the actions in the same order, you need to edit the workflow so it doesn't give the actions UIDs.

 

The UID is how Alfred identifies actions and remembers what you selected in the past. Without UIDs, results are always shown in the same order they're emitted. 

Hi tried to look around in the workflow and couldn't see any obvious place to change this. Any tips?

Link to comment
1 hour ago, deanishe said:

In the xml.scpt and xml-paste.scpt files. The simplest thing to do is probably to edit the xmlItem() function so it doesn't add uid to the output.

I deleted instances / mention of uid in those two files, but now the workflow doesn't really work. Nothing pops up when i choose "case" or "casep". Oh well...

Link to comment

Glad that is working for you.  To be honest, I don't think I've used the keyword version in several years.  You can also delete the two osascript lines in each of the bash scripts and just paste manually (that's actually how I use it).  Or try a shorter delay.

Link to comment
4 hours ago, Fnantier said:

I deleted instances / mention of uid in those two files, but now the workflow doesn't really work. Nothing pops up when i choose "case" or "casep". Oh well...

 

You're not supposed to delete all the mentions. Just the bit that generates the feedback for Alfred

uid.png

Link to comment
  • 2 weeks later...
On 1/11/2017 at 7:26 PM, dfay said:

Here's a completely rewritten version (in Python) which combines the two workflows into one:

 

https://dl.dropboxusercontent.com/u/6601556/Alfred/Case Converter 2.alfredworkflow

 

It uses Alfred's built in Copy to Clipboard with automatic pasting to frontmost app instead of pbcopy in Bash and AppleScript pasting, which seems to give better results.  

 

Works wonderfully! Much appreciated. You should update your first post with this if you haven't :-)

Edited by Fnantier
Link to comment
  • 2 months later...
  • 10 months later...
  • 1 month later...

This workflow is amazing I use it A LOT.

I've thought of an improvement, but when I looks at hacking it, I can't work out how to implement it. I was wondering if it would be possible to mimic the cases in Alfred. 
For example, (see screenshot) instead of current options change this to:

Title Case
Sentence case
UPPER CASE
Capitalize
lowercase

or to be clear between Title Case and Capitalise, show an example

Title Case (The Quick Brown Fox Jumps Over a Lazy Dog)
Sentence Case (The quick brown fox jumps over a lazy dog)
Upper Case (THE QUICK BROWN FOX JUMPS OVER A LAZY DOG)
Capitalize (The Quick Brown Fox Jumps Over A Lazy Dog)
Lowercase (the quick brown fox jumps over a lazy dog)

But the first option would be ok for me just so I can quickly see CAPS!

Screen Shot 2018-03-13 at 09.48.25.png

Link to comment
1 minute ago, robgill said:

This workflow is amazing I use it A LOT.

I've thought of an improvement, but when I looks at hacking it, I can't work out how to implement it. I was wondering if it would be possible to mimic the cases in Alfred. 
For example, (see screenshot) instead of current options change this to:

Title Case
Sentence case
UPPER CASE
Capitalize
lowercase

or to be clear between Title Case and Capitalise, show an example

Title Case (The Quick Brown Fox Jumps Over a Lazy Dog)
Sentence Case (The quick brown fox jumps over a lazy dog)
Upper Case (THE QUICK BROWN FOX JUMPS OVER A LAZY DOG)
Capitalize (The Quick Brown Fox Jumps Over A Lazy Dog)
Lowercase (the quick brown fox jumps over a lazy dog)

But the first option would be ok for me just so I can quickly see CAPS!

Screen Shot 2018-03-13 at 09.48.25.png

 

I prefer keyboard shortcut to a keyword for this workflow, but I can see why others would prefer keyword.

 

I use Cmd+Ctrl+Opt+Shift (yes all modifier keys) +

* L (lower case)

* U (upper case)

* S (sentence case - but I almost never use this)

* T (title case)

 

In the beginning it felt a little like doing finger gymnastics (I use little, ring, middel and thumb for the four modifiers on the left, and index on right hand for the letter), but I've gotten used to it now. On the other hand, the heavy use of modifier keys, it never interferes with anything ?

 

Anyway just for inspiration. Regarding your question, isn't it just a matter of connecting all the python scripts in the workflow to an Input -> Keyword, and then making the keyword titles that you want? See attached screenshots.

 

 

Screen Shot 2018-03-13 at 11.19.31-800.png

Screen Shot 2018-03-13 at 11.19.37-800.png

Screen Shot 2018-03-13 at 11.19.45-800.png

Link to comment
2 minutes ago, Fnantier said:

I prefer keyboard shortcut to a keyword for this workflow, but I can see why others would prefer keyword.


Thanks very much, I didn't even know that was an option! And I prob will prefer that too.
Great tips for splitting the workflow too! :)

Link to comment
8 hours ago, robgill said:

I was wondering if it would be possible to mimic the cases in Alfred. 
For example, (see screenshot) instead of current options change this to:

Title Case
Sentence case
UPPER CASE
Capitalize
lowercase

This is built into the latest version of the workflow as a script filter - see the top post.

Link to comment
  • 8 months later...
  • 1 month later...
1 hour ago, Ptujec said:

And please don't hate me for using LaunchBar.

 

Of course not, but why are you asking for a LaunchBar plugin here? I mean, of all the Mac-related forums you could ask on, can you think of one that has fewer LaunchBar users than the Alfred forum? :) 

Edited by deanishe
Link to comment
1 minute ago, deanishe said:

 

Of course not, but why are you asking for a LaunchBar plugin here? I mean, of all the Mac-related forums you could ask on, can you think of one that has fewer LaunchBar users than the Alfred forum? :) 

 

hahahaha It's not my intention to make the troll here, but this is the undeniable proof of how Alfred Community rules.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...