Scriptable

Scriptable is a iOS app that lets you run JavaScript that you write or copied from the web. It's used in automation, such as with Shortcuts or invoked from other apps.

Feature requests

    • Environment variables, so I can put username & password, API tokens, and other configurable information so that I can share scripts generically and people can punch in the values for their credentials and settings.

    • Location access via widgets (see below).

Widgets

iOS introduced home screen widgets, and apps can add information and interaction that happens without having to swipe to the Today view.

It's unclear how often scripts run, as Apple hasn't documented how often widgets refresh. This could be fairly easy to find out, as one could run a Scriptable app to log to an endpoint and look at the timestamps.

Location is not available to widgets, at least not as of August 23rd, 2020. They are apparently available to widgets in general, though, so this could be a thing the developer of the Scriptable app adds.

Ideas for widgets (especially if location support is added) and limitations:

    • An widget that tells me which Toronto neighbourhood I'm in. I've built web-based back-end for this, and that back-end assumes using Owntracks to send a POST request to the endpoint. The Owntracks app has a strange interface, and it pings the endpoint too often. At least in the Node.js Express framework, one can rate limit. The limitation of this app is that location is not passed from a widget to a Scriptable script quite yet.

    • I built a web app that selects a random book from a Goodreads shelf, to "recommend" which one to read. This would make a good widget. The Goodreads API requires an OAuth token, making it difficult to conceive how to write the JavaScript for doing the API calls.

    • Show me the nearest microconfuence. This would be easy to port over to Scriptable, though it would depend on the refresh rate of widgets.

    • Pick a book from my list of Kindle Samples to read. There isn't an obvious API to the Kindle library data (not content, just the list of books, docs, samples, etc. with some metadata).

    • Select a movie from my Letterboxd watchlist. There is an API for Letterboxd, but emails to the site's owner about getting an API key went unanswered. I could do this with TheMovieDB's API, though, as it has a watchlist feature. There's already a script that more or less does what I want to do.

    • Show an aerial image of where I currently am in Toronto: https://open.toronto.ca/dataset/web-map-services/ Requires location services, but it could also show a random spot.