[Tip] Editing Java Script inside a Draft

I am not sure if this was already discussed elsewhere. TADpole offers a great set of tools to build a simple java script editor to edit run and beautify source code.

In fact it is so good that I spend to much time coding on my iPhone XR

The functions are now in the Power User Action Group


Glad to hear that you are finding those useful @Andreas_Haberle. :sunglasses:

There are a couple of blog posts that might be relevant to people wanting to get started with the scripting actions in that action group. They don’t cover all of the currently available scripting options, but hopefully provide enough guidance to get the gist of what is available.

  1. Drafts: Script Development - the Test Libraries and Executing from Draft sections might be worth a browse.
  2. Drafts: Advanced Logging - if you have actions producing lots of output to the console I find this useful.

As noted in another recent thread, there will be some other functions for the code beautification coming in the next update. I was working on it primarily so that I could have a simple action to fix JavaScript posted on the forum that wasn’t wrapped in back-ticks.

For my own use, I use TAD-Execute Test Function on my Mac a lot as I write most of my code in a test library in VS Code. I then actually have a Keyboard Maestro macro to trigger that switches me into Drafts and then triggers an action by keyboard shortcut. Note the action with a keyboard shortcut is simply an action that calls the TAD-Execute Test Function; that way I keep my keyboard shortcuts out of the library.

On the iPhone and iPad I make use of all of them (specific draft, current draft, current selection, current lines, beautify) and write predominantly in a draft rather than an external editor. Though if I am editing my test library on i*OS, I tend to do that in Textastic, and that is probably the one I use least, unless I’m testing something that I’ve just written on the Mac.