Jump to content

Node Webkit Toolbox


Recommended Posts

Hi,

 

Since Node Webkit doesn't do much by itself, I created a workflow to make it easier to use it. This workflow is large because it has the full Node Webkit contained inside. What this allows is to create full desktop applications using simply HTML, CSS, and JavaScript of the Node flavor. Any Node library can be used with the application.

 

Once you have your application developed, you can zip it up with a config.json file.

 

This workflow provides the following:

nw:website

This opens the Node Webkit website on GitHub.

nw:open

When the user starts typing, a file ending in the ".nw" extension is looked for according to the work typed. Therefore, if there is a file called "new.nw", as soon as "n" is typed , that file will be displayed.

nw:opendir

Opens the current directory in Finder or Path Finder using Node Webkit. The config.json file should be in that directory.

nw:help

Opens this help program. This is an example of the minimum needed for a Node Webkit application.

There are also two File Actions defined: Open Directory that is available on directories, and Open Package that is available on Node Webkit packages.

There are also two External Triggers: RunNodeWKDirectory and RunNodeWKPackage which work the same as the file actions. These allow external programs or other Alfred workflows to call a Node Webkit application by passing the full path of the application bundle or directory. The help option for this workflow shows an example of using these External Triggers.

The following code will open the help application that is located in the same directory as the code:
 

thisDir=`pwd`;

/usr/bin/osascript -e "tell application \"Alfred 2\" to run trigger \"RunNodeWKDirectory\" in workflow \"com.customct.NodeWebkit\" with argument \"$thisDir/help\""

The directory path given in the argument tells Node Webkit where to load the program from. It is set with the pwd command.

There will be more tutorials and hacks using this workflow on my website Custom Computer Tools.

 

Version:  1.0

GitHub:   https://github.com/raguay/MyAlfred/blob/master/NodeWebkitToolbox.alfredworkflow
 

This workflow is too big for http://www.packal.org/. Therefore, you can only download it from my GitHub account.

Edited by raguay.customct
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...