Skip to content

Instantly share code, notes, and snippets.

@tommorris
Created April 24, 2017 11:01
Show Gist options
  • Save tommorris/307bd7cb7244083f16c6451620da01d6 to your computer and use it in GitHub Desktop.
Save tommorris/307bd7cb7244083f16c6451620da01d6 to your computer and use it in GitHub Desktop.
FoldingText launcher written in JXA (JS for macOS Scripting Architecture). copy into your path and rename to whatever you want it to be (I use `ft`).
#!/usr/bin/env osascript -l JavaScript
ObjC.import('AppKit')
function run(argv) {
if (!(Application('FoldingText').running())) {
$.NSWorkspace.sharedWorkspace.launchApplication('/Applications/FoldingText.app')
}
var ft = Application("FoldingText");
argv.forEach(function (item) {
var fpath = Path(item);
ft.open(fpath);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment