Giter Site home page Giter Site logo

linusmimietz / scriptable-auto-update Goto Github PK

View Code? Open in Web Editor NEW
26.0 3.0 0.0 22 KB

This simple wrapper for your Scriptable code automatically updates it locally every day.

License: MIT License

JavaScript 100.00%
scriptable scriptable-app ios14-widget wrapper

scriptable-auto-update's Introduction

Scriptable Auto Update

This simple wrapper for your Scriptable code automatically updates it locally every day.

Loop GIF

Motivation

I'm a big fan of the Scriptable app. It's an excellent tool for creating custom widgets, for example. When sharing my code with other people, I didn't find an easy way to fix bugs or add features afterward. This wrapper aims to solve this challenge.

Features

  • Automatically downloads your latest code every day from a URL
  • If the update fails, it uses the latest locally available version
  • Cleans up old locally saved versions automatically
  • Executes your code every time it gets run

Usage

The wrapper will run the main() function of your code every time it gets executed. Therefore it's necessary to export the function at the end of your file like so:

module.exports = {
  main
};

Copy the content from main.js and add your custom values to the scriptName & scriptUrl variables at the top of the file. Then simply paste it into Scriptable. The wrapper will automatically load and update your code from the URL.

Example

Take a look inside the example folder to see an implementation example.
Want to try it out? Then simply copy the content of example/main.js and paste it into Scriptable!

License

This repository is available under the MIT license.

scriptable-auto-update's People

Contributors

linusmimietz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

scriptable-auto-update's Issues

Still working?

That's a very interesting approach. Is this script still working for you? When I copy the code from example/main.js to my iPhone (iOS 15.7). It's not working for me. I get the following error.

Error on line 8:36: No file to import at /private/var/mobile/Library/Mobile Documents/iCloud~ dk~ simonbs~ Scriptable/Documents/AutoUpdateExample/19262.js

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.