Script hooks?


#1

Any chance of getting script hooks, i.e. a way to set a script to automatically run on load or on close?

(cf. https://groups.google.com/forum/m/#!msg/taskpaper/7nXCjg_Q5XU/3QfZ61VZGAUJ from 2009 )


#2

+1
I also would really love this!


#3

Technically the plugin loading is pretty simple do do. I added a fairly extensive plugin system to FoldingText, TaskPaper could follow along the same lines. What’s been holding me back is the install/update process.

I’d really like something like the package manager that Atom has. So you can install and update plugins easily from within app. And so old outdated plugins don’t get loaded, etc. But I don’t want to build such a system from scratch myself. And it seems like even trying to integrated existing systems (such as NPM) would be a big job.

Maybe I’m overthinking things, but with FoldingText it felt like I was reinventing and existing wheel badly.

Does anyone have suggestions on any Mac apps that implement a robust plugin system? Maybe there’s some simpler approach that I’m not considering.


#4

Well, a package management infrastructure would be great to have, but it would also be a pity to withhold plugins altogether for lack of one. TP doesn’t have such a system for themes either, but we do use themes nonetheless, and we are better off with them than without. One step at a time, methinks… I suspect the package manager will come more easily if there is already a “critical mass” of plugins to manage.

PS: Could the package manager itself be a plugin or script (as in Packal or PackageControl)?


#5

Yes, I agree – no need for a full plug-in infrastructure, just the option to run a script on open / file save / close .


#6

Not easily … right now all scripts run in the JavaScript context which doesn’t provide filesystem access, etc.


#7

Anyway… I think I won’t do this for the 3.5 release, to much already, but maybe sooner then I had originally thought after that.


#8

Given scripts can listen for events once they’ve been run once, like @dannynelson’s repeating tasks script, it would be extremely useful just to have certain scripts run automatically on launch. It could be as simple as a separate script folder, no fancy plugin system needed.

I’d hate to relaunch TaskPaper, forget to start the script, and start losing my repeating tasks.