Jump to content

What JS engine is Alfred using?


Recommended Posts

3 minutes ago, deanishe said:

 

Why not give it a try then and find out? I'm sure a lot of people would be interested to know if it works.

 

How could I?

 

AFAIK this would have to be compiled with Alfred's code.

Link to comment
6 minutes ago, pier said:

 

How could I?

 

AFAIK this would have to be compiled with Alfred's code.

 

Not at all. You do it exactly like I just described (using Language = /bin/bash).

 

If you can run it from a shell, you can run it from Alfred (with some minor complications due to the stripped-down environment).

 

Alfred doesn't have built-in support for any language (apart from a bit of AppleScript). It just runs whichever program you point it at using precisely the same mechanism as child_process in Node.

 

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

 

Not at all. You do it exactly like I just described (using Language = /bin/bash).

 

If you can run it from a shell, you can run it from Alfred (with some caveats due to the stripped-down environment).

 

Alfred doesn't have built-in support for any language (apart from a bit of AppleScript). It just runs whichever program you point it at using precisely the same mechanism as child_process in Node.

 

 

Um I'm not following you. We are talking about Nodekit, right?

 

Yes I could just node whatever.js but the problem of distributing workflows that use node would still persist.

 

On a side note. Is there a way of showing a message to the user from the workflow and inform Node is needed?

Link to comment
5 minutes ago, pier said:

Um I'm not following you. We are talking about Nodekit, right?

 

We're talking about everything. If you can run it in a shell, you can paste the same command in Alfred's Code box (with Language = /bin/bash) and Alfred will run it. (With some caveats due to Alfred not using your shell's environment.)

 

Alfred doesn't care what language your workflow is written in.

 

5 minutes ago, pier said:

the problem of distributing workflows that use node would still persist.

 

The only problem is that Node isn't installed by default. If you're using something that isn't as huge as Node, you can include it in the workflow itself, thereby solving the problem.

 

6 minutes ago, pier said:

On a side note. Is there a way of showing a message to the user from the workflow and inform Node is needed?

 

Yes. Plenty of ways. An Alfred notification. A Large Type output. An AppleScript dialog box.

 

Put this in a Run Script action (Language = /bin/bash) and connect it to a Post Notification output with the option "Only show if the input has content":

test -f /usr/local/bin/node || echo "Node not installed"

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