JavaScript version?

Hey there! Iam new to JavaScript and I’m really trying to learn just to be able to use the excellent Scriptable . I’ve tried some Lynda.com and Udemy corses, but I’m struggling to find a course that reflects the exact syntax of Scriptable… the courses I found teach things like Prompt and Alert that are a bit different from the way Scriptable accepts… Is there a specific version of JavaScript that Scriptable uses which I can research?
Another question :slight_smile: what’s the syntax on Scriptable to import external APIs (like todoist.js)?
Thank you!!

It certainly seems to support ES 6 with the things I’ve tried using but looking at the inbuilt docs, the licensing in the beta, and the release notes in TestFlight, I don’t see any specifics.

In terms of the specifics of Scriptable, from the app description:

"A new approach to automation. Automate tasks using JavaScript with bridges to the native APIs such as the file system, alerts, pasteboard, image picker and much more.

- Native APIs bridged ti JavaScript with comprehensive documentation"

As a brand new application which integrates with the iOS system rather than with a web browser thee are fundamental differences in the aim and the approach. This ia also why the app specific documentation is within the app.

If you learn about ES 6 and look at the in app documentation, you should have everything you require for now; but if you learn just ‘some’ JavaScript, regardless of version, and read the documentation in the app you will be able to do things and then as you want to do more just keep expanding your reading and understanding.

The chances are that when the public release occurs there will be more information available about it, and I expect what base version engine of JavaScript has been integrated will be covered. My best guess would be it is using the inbuilt iOS JavaScriptCore and so support might be tied to Apple’s development of that.

In terms of accessing JavaScript libraries that enable you to access web APIs, take a look at this thread - Import one script from another? - Scriptable. It gives an example for accessing a local file and evaluating the content so that the executing script can use it. Many web sites would take copies and store them locally for performance reasons, so I’d give some consideration to that approach.

However, you could extrapolate the same approach to pull in the library content from a remote source rather than a local source and then evaluate it once the content has been retrieved,

Hope that helps.

1 Like

Thank you very much!!

Yes, it supports ES6.

In all honesty, I do not have more documentation prepared for the launch. I’ve been on a tight time frame to get this done for the iOS 12 launch so some things have been down prioritized. However, if there’s anything in particular you’d like to know, I’m happy to answer. Then I might gather some of these answers on a website later.

It does indeed use JavaScriptCore.

1 Like

I assumed you would have some supporting stuff for marketing via your web site, etc. including a more mainstream, non-beta style pitch for the app store itself. I also suspected there might be some app reviews that might explore areas not covered by the information that’s already out there.

:sunglasses: I don’t personally have any burning questions right now - I’m assuming that an answer to the obvious one on pricing information will be imminent. I was just trying to provide something for aalants in response to the original questions.

1 Like