Programmer’s Guides?

Complete newbie/neophyte here.

I would like to use Scriptable on my new iPhone, to see what’s possible, and maybe to help control things in my home.

Seems to me there are two parts to this:
Knowing enough about what iOS provides (in order to know where to start and what is possible)
Building literacy in the Javascript-ified interfaces to the iOS services.

There seems to be lots of Scriptable documentation at:
but in order for that to make sense, I need to be literate in the ways of iOS.

So, where should I start so that I can build my iOS “programmer literacy?”

Thanks in advance for your patience with a newcomer; I realize this is a very general question!

I would suggest that you start with the tutorials on MDN. Yes, they are about JavaScript in browsers, but it will help you nonetheless when you want to automate websites with Scriptable. And don’t freak out when you don’t understand what certain words mean. Just keep reading the tutorials. But not only read them, also try them for yourself. You’ll learn most when you try it yourself.

When you reached a level where you can read code without looking everything up and understand what most bits are doing (especially how Promises and async/await (aka. asynchronous Code) works and what classes are and how to use them (you don’t have to build classes yourself)) then you can start reading scripts that people made for Scriptable. Have a look in the gallery tab of Scriptable. There you’ll find simple scripts like Is Slack down?, What is my Elevation (widget), Reminders due today, Todays xkcd Comic. Generally, shorter scripts are easier to understand. Try them and see what they do. Try to read their code and from that you should slowly begin to understand how to use the functions that Scriptable provides.

Just one heads up: When you need to assign an object to a property of a Scriptable class (like request.body or request.header) then build the complete object beforehand and assign it as the last step. Otherwise if you try something like request.header["content-type"] = "application/json" then it won’t assign that. If you didn’t understand what I meant with that, then ignore it and come back when you have read and tried some Scriptable scripts. It will then (hopefully) make sense!

1 Like

@schl3ck thanks so much for taking the time to reply; sounds like the best way to learn is to:

  • build basic javascript literacy (paying particular attention to asynchronous programming)

  • Learn from examples in the gallery, i. e., look for something simple, to start with.

I’ll try to look for some simpler starter examples, then.