Jump to content
derBingle

Change clipboard case

Recommended Posts

2 hours ago, derBingle said:

Would love any feedback/suggestions!

 

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

 

Could this work as JXA? That way, it would run on every Mac.

 

Share this post


Link to post
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! ;)

Share this post


Link to post
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. 

Share this post


Link to post
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.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...