Jump to content

Change clipboard case


Recommended Posts

On 8/2/2017 at 3:41 PM, deanishe said:

Node is a pretty hardcore dependency for such a simple workflow.

 

 

Thanks for the feedback, @deanishe. I don't disagree—Node's just what I'm working day to day and JS is the only language I'm comfortable in (working on that, though!). I already knew/used the Lodash string functions and smart title case module, so it was quick and easy to put this together. I have quite a few personalized Alfred workflows that use node extensively, so I didn't even think about it. But you're right.

 

I might just compile the script to a binary for non-node users — seems a lot less complicated that switching to JXA, adding browersify to bundle the required modules. But I'm open to suggestions. :)

 

 

@dfay  This workflow only exists because I was needing the 3 programming-related cases—the sentence related ones were more of a "might as well add it while I'm here" afterthought. So definitely no workflow-infringement intended here - if people don't need snake/kebab/camel case, they should definitely use yours! ;)

Link to comment
1 hour ago, derBingle said:

I might just compile the script to a binary for non-node users — seems a lot less complicated that switching to JXA, adding browersify to bundle the required modules. But I'm open to suggestions

 

Can the code not be more-or-less copy-pasted? Is some massive JS build-pipeline really required?

 

How big, exactly, would that binary be? I mean, does it include Node?

 

More generally, the "global install" method (in this case, using "npm install -g") is not a good idea. 

 

In terms of Alfred workflows, it means your workflow doesn't sync across machines like well-behaved (self-contained) workflows.

 

In more general Node terms (though the same applies to Ruby and Python), it sets your workflow up to break/be broken by other software, as you can only install one version of a library at a time globally.

 

You probably don't want to open yourself up to many years of support requests/bug reports because your globally-installed program requires a different version of library X to program Y. 

Link to comment
On 04/08/2017 at 10:47 PM, FroZen_X said:

ummm am i wrong or can all this be achieved with Alfred functions oO "Replace" and "Transform", that's what I'm using however plus some regex.

 

Most of it, yeah. The workflow I use also has a "slugify" mode, which can't be done (easily) within Alfred. In any case, it's generally easier to write two lines of code that add a bunch of Alfred elements, and you can't show a "live preview" in a Script Filter, either.

Link to comment
  • 1 month later...

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...