Last active
August 29, 2015 14:17
-
-
Save joech4n/3f4222773a1aca9c491a to your computer and use it in GitHub Desktop.
MathJS - Alfred Workflow Script Filter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Created with the following resources | |
# http://www.alfredforum.com/topic/37-feature-request-run-javascriptnodejs-scripts/#entry2262 | |
# https://github.com/lrrfantasy/alfred-feedback-xml-generation/#nodejs | |
# Bootstrapped workflow here is probably better: https://github.com/giangvo/alfred-workflow-nodejs | |
/usr/local/bin/node <<-'CODE' | |
try { | |
var query = "{query}"; | |
var Feedback = require('./Feedback'); | |
var math = require('./math'); | |
var result = math.eval(query); | |
var foo = new Feedback({ | |
uid: 'itemuid', | |
arg: 'itemarg', | |
title: result, | |
subtitle: query, | |
icon: 'icon.png', | |
valid: 'yes', | |
autocomplete: 'autocomplete' | |
}); | |
console.log(foo.toString()); | |
} catch (e) { | |
console.log(e.message); | |
} | |
CODE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment