(As an example, the one script I’m trying to get right is to append the current draft contents to a specific draft in my archive.)
So just as a quick update, I ended up figuring out how to edit @agiletortoise’s action to append to a draft based on a prompt to instead append to a fixed draft based on UUID.
I did this by poking around the documentation and a little trial and error. I really found I was stumbling around in the dark on it though, so would be nice again to have a really basic tutorial to get me up to speed.
My (working!) script:
// append draft contents to an existing draft
let d = Draft.find("your uuid goes here")
// append current draft
d.content = d.content + "\n" + draft.content
- Try to learn what is provided via the browser and the document object model (DOM), and what is the core language. You can utilise the latter in Drafts.
- Read the Drafts scripting documentation.
- They describe things pretty well for anyone who has worked with any sort of programming language that has a modicum of object support.
- Read through some examples on the forum.
- This forum has lots of examples posted on it already. Try searching if you are looking for an example of something in particular.
- If you get stuck, post a question and ask for assistance.
- Continue to look at actions in the action directory.
- Pick them apart, change them, destroy them and bend them to your will
Hope that helps.