Built-in Palette Scripts

I’m trying to simultaneously learn JavaScript and scripting TaskPaper. I’ve written a couple of simple scripts and installed them. But I was wondering: is the source for the scripts that come built into the Palette menu available to look at?

I think you might just be able to find your way to the source of those commands through the Safari Debugger (if Developer options are enabled in your Safari installation) …

but – not sure what Jesse thinks – my personal guess is that they probably aren’t ideal material for learning JS or TaskPaper scripting:

  • They will use a lot of private and lowel level API, rather than the set of cleaner and more abstract methods and properties exposed through the editor object to scripters.
  • They could also prove quite hard to follow in the early days of JS learning, and may sometimes require familiarity with the NodeJS module system, rather than the simpler JavaScript for Automation environment.

(Perhaps a bit like learning to drive by peering under the hood, or studying the automobile production line. They are certainly JS source code, but I wouldn’t really call them scripts)

This is all correct.

But if you are up for it please feel free to look into the code, it should be relatively clean I think. The issue is they are all provided by JavaScript code directly, not wrapped into scripts that can be run in Script Editor. To make any use of them you would need to copy the right portions of the code and paste them into your own Script Editor based script.

You might have better luck learning by just browsing through:

Makes sense. Thanks for the prompt responses!