{"id":16527214,"url":"https://github.com/jimmy-zhening-luo/scriptable","last_synced_at":"2025-03-21T09:31:20.200Z","repository":{"id":65434496,"uuid":"579558073","full_name":"jimmy-zhening-luo/scriptable","owner":"jimmy-zhening-luo","description":"Scriptable iOS/iPadOS lets users author JavaScript procedures invokable by Apple Shortcuts or Widgets, useful for complex device/home automation and data transforms. This TypeScript project provides a standard class with hooks for Shortcut and filesystem I/O (e.g. settings/cache), transpiling to valid Scriptable code.","archived":false,"fork":false,"pushed_at":"2024-10-30T00:30:34.000Z","size":5296,"stargazers_count":4,"open_issues_count":14,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-30T00:46:13.909Z","etag":null,"topics":["apple","automation","ios","ipad","ipados","iphone","scriptable","shortcuts","typescript","widget"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jimmy-zhening-luo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-18T04:37:50.000Z","updated_at":"2024-10-30T00:30:38.000Z","dependencies_parsed_at":"2023-12-14T00:33:49.260Z","dependency_job_id":"cd00df35-c45b-43df-b251-96f4b35af5b0","html_url":"https://github.com/jimmy-zhening-luo/scriptable","commit_stats":null,"previous_names":["jimmy-zhening-luo/scriptable-wild","jimmy-zhening-luo/scriptable"],"tags_count":696,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimmy-zhening-luo%2Fscriptable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimmy-zhening-luo%2Fscriptable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimmy-zhening-luo%2Fscriptable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimmy-zhening-luo%2Fscriptable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jimmy-zhening-luo","download_url":"https://codeload.github.com/jimmy-zhening-luo/scriptable/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244130219,"owners_count":20402753,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apple","automation","ios","ipad","ipados","iphone","scriptable","shortcuts","typescript","widget"],"created_at":"2024-10-11T17:34:04.562Z","updated_at":"2025-03-21T09:31:20.187Z","avatar_url":"https://github.com/jimmy-zhening-luo.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `type-scriptable`\n[![Azure Publish (PROD.main)](https://github.com/jimmy-zhening-luo/scriptable/actions/workflows/PROD.main.yml/badge.svg)](https://github.com/jimmy-zhening-luo/scriptable/actions/workflows/PROD.main.yml)\n\n- [What is `Scriptable`?](#what-is-scriptable)\n- [What is `type-scriptable`?](#what-is-type-scriptable)\n- [How to use](#how-to-use)\n  - [Vocabulary](#vocabulary)\n    - [`App`](#app)\n    - [`Library`](#library)\n  - [EASY: Write `Library` scripts](#easy-write-library-scripts)\n  - [NOT SO EASY: Write `App` scripts](#not-so-easy-write-app-scripts)\n    - [The Header ™](#the-header-)\n    - [Line 1](#line-1)\n    - [Line 2](#line-2)\n    - [Line 3](#line-3)\n    - [Line 4 _(Optional)_](#line-4-optional)\n\n## What is `Scriptable`?\n`Scriptable` for `iOS` and `iPadOS` lets users author JavaScript procedures invokable by `Apple` `Shortcuts`, `Share Sheet` or `Widgets`, useful for home and device automation.\n\nBesides the aforementioned entry-points, `Scriptable` provides integration points into `iOS`/`iPadOS` filesystem and notifications.\n\n## What is `type-scriptable`?\nWrite type-safe, concise, continuously-deployed Scriptable apps.\n\n## How to use\n\n### Vocabulary\nThere are two types of scripts.\n\n#### `App`\nTop-level `JavaScript` file in your device's `Scriptable` folder. It is visible in the Scriptable app UI, force push menu, Share Sheet, Shortcuts, etc.\n\n#### `Library`\n`JavaScript` file in a subdirectory of your device's `Scriptable` folder. It can not be directly invoked, and can only be used within another script (App or Library) via [`importModule`](https://docs.scriptable.app/importmodule/).\n\n### EASY: Write `Library` scripts\nThere are two (2) special requirements for writing a `Library`:\n\n1. `Library` scripts must ___not___ be in the top-level directory of your device's `Scriptable` folder. Instead, they must be in any of the following:\n    - A subdirectory of your device's `Scriptable` folder\n    - Anywhere (top-level or otherwise) in a [place](https://docs.scriptable.app/importmodule/) where Scriptable's `importModule` function will look\n1. (Identical to [`App` requirement](#not-so-easy-write-app-scripts)) Your script must only use the following globals:\n    - [`Scriptable` objects](https://docs.scriptable.app/)\n    - Apple [`JavaScriptCore`](https://developer.apple.com/documentation/javascriptcore) native objects\n\n### NOT SO EASY: Write `App` scripts\nConversely, there are three (3) special requirements for writing an `App`:\n\n1. Your script must be in the top-level directory of your device's `Scriptable` folder.\n1. Your script must only use the following globals:\n    - [`Scriptable` objects](https://docs.scriptable.app/)\n    - Apple [`JavaScriptCore`](https://developer.apple.com/documentation/javascriptcore) native objects\n1. Your Script must begin with a very specific [header](./.vscode/Header.code-snippets):\n\n#### The Header \u0026trade;\nThis project has `VSCode` [snippets](./.vscode/Header.code-snippets) to generate Lines 1-3 (and optionally 4) of the Scriptable Header.\n\nIts grammar is implemented from the source of truth below:\n\n#### Line 1\n\n```javascript\n// Variables used by Scriptable.\n```\n\n#### Line 2\n\n```javascript\n// These must be at the very top of the file. Do not edit.\n```\n\n#### Line 3\nLine 3 specifies your `App`'s icon in Scriptable UI.\n\n```javascript\n// icon-color: $COLOR; icon-glyph: $GLYPH;\n```\n\n- `$COLOR` is a color from a [predefined list](#color).\n- `$GLYPH` is a glyph from a [predefined list](#glyph).\n\n\u003e [!IMPORTANT]\n\u003e ___HUGE___ credit to [__@nlawler1737__](https://github.com/nlawler1737) for being the first (to my knowledge) to document the possible values for `$COLOR` and `$GLYPH`.\n\n##### [`$COLOR`](https://github.com/nlawler1737/Scriptable/blob/main/Glyph%20%26%20Color%20Changer.js)\n\n\u003cdetails\u003e\n\u003csummary\u003eColors (18)\u003c/summary\u003e\n\n| Name          | Color                |\n| ------------- | -------------------- |\n| `red`         | `hsl(6, 68%, 55%)`   |\n| `pink`        | `hsl(343, 68%, 55%)` |\n| `purple`      | `hsl(286, 54%, 47%)` |\n| `deep-purple` | `hsl(260, 48%, 51%)` |\n| `deep-blue`   | `hsl(234, 48%, 55%)` |\n| `blue`        | `hsl(213, 75%, 61%)` |\n| `cyan`        | `hsl(192, 55%, 59%)` |\n| `teal`        | `hsl(172, 32%, 49%)` |\n| `deep-green`  | `hsl(110, 40%, 55%)` |\n| `green`       | `hsl(84, 45%, 58%)`  |\n| `yellow`      | `hsl(43, 77%, 62%)`  |\n| `orange`      | `hsl(32, 78%, 58%)`  |\n| `light-brown` | `hsl(23, 37%, 48%)`  |\n| `brown`       | `hsl(19, 44%, 39%)`  |\n| `deep-brown`  | `hsl(27, 47%, 29%)`  |\n| `light-gray`  | `hsl(235, 5%, 54%)`  |\n| `gray`        | `hsl(227, 6%, 44%)`  |\n| `deep-gray`   | `hsl(210, 8%, 30%)`  |\n\u003c/details\u003e\n\n###### [`$GLYPH`](https://github.com/nlawler1737/Scriptable/blob/4ccf80b72ef5f15d4ed00b282988612bb9dbf4fc/iconGlyphCss.txt#L17)\n\n\u003cdetails\u003e\n\u003csummary\u003eGlyphs (809)\u003c/summary\u003e\n\n```txt\nad\naddress-book\naddress-card\nadjust\nair-freshener\nalign-center\nalign-justify\nalign-left\nalign-right\nallergies\nambulance\namerican-sign-language-interpreting\nanchor\nangle-double-down\nangle-double-left\nangle-double-right\nangle-double-up\nangle-down\nangle-left\nangle-right\nangle-up\nangry\nankh\napple-alt\narchive\narchway\narrow-alt-circle-down\narrow-alt-circle-left\narrow-alt-circle-right\narrow-alt-circle-up\narrow-circle-down\narrow-circle-left\narrow-circle-right\narrow-circle-up\narrow-down\narrow-left\narrow-right\narrow-up\narrows-alt\narrows-alt-h\narrows-alt-v\nassistive-listening-systems\nasterisk\nat\natlas\natom\naudio-description\naward\nbackspace\nbackward\nbalance-scale\nban\nband-aid\nbarcode\nbars\nbaseball-ball\nbasketball-ball\nbath\nbattery-empty\nbattery-full\nbattery-half\nbattery-quarter\nbattery-three-quarters\nbed\nbeer\nbell\nbell-slash\nbezier-curve\nbible\nbicycle\nbinoculars\nbirthday-cake\nblender\nblind\nbold\nbolt\nbomb\nbone\nbong\nbook\nbook-open\nbook-reader\nbookmark\nbowling-ball\nbox\nbox-open\nboxes\nbraille\nbrain\nbriefcase\nbriefcase-medical\nbroadcast-tower\nbroom\nbrush\nbug\nbuilding\nbullhorn\nbullseye\nburn\nbus\nbus-alt\nbusiness-time\ncalculator\ncalendar\ncalendar-alt\ncalendar-check\ncalendar-minus\ncalendar-plus\ncalendar-times\ncamera\ncamera-retro\ncannabis\ncapsules\ncar\ncar-alt\ncar-battery\ncar-crash\ncar-side\ncaret-down\ncaret-left\ncaret-right\ncaret-square-down\ncaret-square-left\ncaret-square-right\ncaret-square-up\ncaret-up\ncart-arrow-down\ncart-plus\ncertificate\nchalkboard\nchalkboard-teacher\ncharging-station\nchart-area\nchart-bar\nchart-line\nchart-pie\ncheck\ncheck-circle\ncheck-double\ncheck-square\nchess\nchess-bishop\nchess-board\nchess-king\nchess-knight\nchess-pawn\nchess-queen\nchess-rook\nchevron-circle-down\nchevron-circle-left\nchevron-circle-right\nchevron-circle-up\nchevron-down\nchevron-left\nchevron-right\nchevron-up\nchild\nchurch\ncircle\ncircle-notch\ncity\nclipboard\nclipboard-check\nclipboard-list\nclock\nclone\nclosed-captioning\ncloud\ncloud-download-alt\ncloud-upload-alt\ncocktail\ncode\ncode-branch\ncoffee\ncog\ncogs\ncoins\ncolumns\ncomment\ncomment-alt\ncomment-dollar\ncomment-dots\ncomment-slash\ncomments\ncomments-dollar\ncompact-disc\ncompass\ncompress\nconcierge-bell\ncookie\ncookie-bite\ncopy\ncopyright\ncouch\ncredit-card\ncrop\ncrop-alt\ncross\ncrosshairs\ncrow\ncrown\ncube\ncubes\ncut\ndatabase\ndeaf\ndesktop\ndharmachakra\ndiagnoses\ndice\ndice-five\ndice-four\ndice-one\ndice-six\ndice-three\ndice-two\ndigital-tachograph\ndirections\ndivide\ndizzy\ndna\ndollar-sign\ndolly\ndolly-flatbed\ndonate\ndoor-closed\ndoor-open\ndot-circle\ndove\ndownload\ndrafting-compass\ndraw-polygon\ndrum\ndrum-steelpan\ndumbbell\nedit\neject\nellipsis-h\nellipsis-v\nenvelope\nenvelope-open\nenvelope-open-text\nenvelope-square\nequals\neraser\neuro-sign\nexchange-alt\nexclamation\nexclamation-circle\nexclamation-triangle\nexpand\nexpand-arrows-alt\nexternal-link-alt\nexternal-link-square-alt\neye\neye-dropper\neye-slash\nfast-backward\nfast-forward\nfax\nfeather\nfeather-alt\nfemale\nfighter-jet\nfile\nfile-alt\nfile-archive\nfile-audio\nfile-code\nfile-contract\nfile-download\nfile-excel\nfile-export\nfile-image\nfile-import\nfile-invoice\nfile-invoice-dollar\nfile-medical\nfile-medical-alt\nfile-pdf\nfile-powerpoint\nfile-prescription\nfile-signature\nfile-upload\nfile-video\nfile-word\nfill\nfill-drip\nfilm\nfilter\nfingerprint\nfire\nfire-extinguisher\nfirst-aid\nfish\nflag\nflag-checkered\nflask\nflushed\nfolder\nfolder-minus\nfolder-open\nfolder-plus\nfont\nfootball-ball\nforward\nfrog\nfrown\nfrown-open\nfunnel-dollar\nfutbol\ngamepad\ngas-pump\ngavel\ngem\ngenderless\ngift\nglass-martini\nglass-martini-alt\nglasses\nglobe\nglobe-africa\nglobe-americas\nglobe-asia\ngolf-ball\ngopuram\ngraduation-cap\ngreater-than\ngreater-than-equal\ngrimace\ngrin\ngrin-alt\ngrin-beam\ngrin-beam-sweat\ngrin-hearts\ngrin-squint\ngrin-squint-tears\ngrin-stars\ngrin-tears\ngrin-tongue\ngrin-tongue-squint\ngrin-tongue-wink\ngrin-wink\ngrip-horizontal\ngrip-vertical\nh-square\nhamsa\nhand-holding\nhand-holding-heart\nhand-holding-usd\nhand-lizard\nhand-paper\nhand-peace\nhand-point-down\nhand-point-left\nhand-point-right\nhand-point-up\nhand-pointer\nhand-rock\nhand-scissors\nhand-spock\nhands\nhands-helping\nhandshake\nhashtag\nhdd\nheading\nheadphones\nheadphones-alt\nheadset\nheart\nheartbeat\nhelicopter\nhighlighter\nhistory\nhockey-puck\nhome\nhospital\nhospital-alt\nhospital-symbol\nhot-tub\nhotel\nhourglass\nhourglass-end\nhourglass-half\nhourglass-start\ni-cursor\nid-badge\nid-card\nid-card-alt\nimage\nimages\ninbox\nindent\nindustry\ninfinity\ninfo\ninfo-circle\nitalic\njedi\njoint\njournal-whills\nkaaba\nkey\nkeyboard\nkhanda\nkiss\nkiss-beam\nkiss-wink-heart\nkiwi-bird\nlandmark\nlanguage\nlaptop\nlaptop-code\nlaugh\nlaugh-beam\nlaugh-squint\nlaugh-wink\nlayer-group\nleaf\nlemon\nless-than\nless-than-equal\nlevel-down-alt\nlevel-up-alt\nlife-ring\nlightbulb\nlink\nlira-sign\nlist\nlist-alt\nlist-ol\nlist-ul\nlocation-arrow\nlock\nlock-open\nlong-arrow-alt-down\nlong-arrow-alt-left\nlong-arrow-alt-right\nlong-arrow-alt-up\nlow-vision\nluggage-cart\nmagic\nmagnet\nmail-bulk\nmale\nmap\nmap-marked\nmap-marked-alt\nmap-marker\nmap-marker-alt\nmap-pin\nmap-signs\nmarker\nmars\nmars-double\nmars-stroke\nmars-stroke-h\nmars-stroke-v\nmedal\nmedkit\nmeh\nmeh-blank\nmeh-rolling-eyes\nmemory\nmenorah\nmercury\nmicrochip\nmicrophone\nmicrophone-alt\nmicrophone-alt-slash\nmicrophone-slash\nmicroscope\nminus\nminus-circle\nminus-square\nmobile\nmobile-alt\nmoney-bill\nmoney-bill-alt\nmoney-bill-wave\nmoney-bill-wave-alt\nmoney-check\nmoney-check-alt\nmonument\nmoon\nmortar-pestle\nmosque\nmotorcycle\nmouse-pointer\nmusic\nneuter\nnewspaper\nnot-equal\nnotes-medical\nobject-group\nobject-ungroup\noil-can\nom\noutdent\npaint-brush\npaint-roller\npalette\npallet\npaper-plane\npaperclip\nparachute-box\nparagraph\nparking\npassport\npastafarianism\npaste\npause\npause-circle\npaw\npeace\npen\npen-alt\npen-fancy\npen-nib\npen-square\npencil-alt\npencil-ruler\npeople-carry\npercent\npercentage\nphone\nphone-slash\nphone-square\nphone-volume\npiggy-bank\npills\nplace-of-worship\nplane\nplane-arrival\nplane-departure\nplay\nplay-circle\nplug\nplus\nplus-circle\nplus-square\npodcast\npoll\npoll-h\npoo\npoop\nportrait\npound-sign\npower-off\npray\npraying-hands\nprescription\nprescription-bottle\nprescription-bottle-alt\nprint\nprocedures\nproject-diagram\npuzzle-piece\nqrcode\nquestion\nquestion-circle\nquidditch\nquote-left\nquote-right\nquran\nrandom\nreceipt\nrecycle\nredo\nredo-alt\nregistered\nreply\nreply-all\nretweet\nribbon\nroad\nrobot\nrocket\nroute\nrss\nrss-square\nruble-sign\nruler\nruler-combined\nruler-horizontal\nruler-vertical\nrupee-sign\nsad-cry\nsad-tear\nsave\nschool\nscrewdriver\nsearch\nsearch-dollar\nsearch-location\nsearch-minus\nsearch-plus\nseedling\nserver\nshapes\nshare\nshare-alt\nshare-alt-square\nshare-square\nshekel-sign\nshield-alt\nship\nshipping-fast\nshoe-prints\nshopping-bag\nshopping-basket\nshopping-cart\nshower\nshuttle-van\nsign\nsign-in-alt\nsign-language\nsign-out-alt\nsignal\nsignature\nsitemap\nskull\nsliders-h\nsmile\nsmile-beam\nsmile-wink\nsmoking\nsmoking-ban\nsnowflake\nsocks\nsolar-panel\nsort\nsort-alpha-down\nsort-alpha-up\nsort-amount-down\nsort-amount-up\nsort-down\nsort-numeric-down\nsort-numeric-up\nsort-up\nspa\nspace-shuttle\nspinner\nsplotch\nspray-can\nsquare\nsquare-full\nsquare-root-alt\nstamp\nstar\nstar-and-crescent\nstar-half\nstar-half-alt\nstar-of-david\nstar-of-life\nstep-backward\nstep-forward\nstethoscope\nsticky-note\nstop\nstop-circle\nstopwatch\nstore\nstore-alt\nstream\nstreet-view\nstrikethrough\nstroopwafel\nsubscript\nsubway\nsuitcase\nsuitcase-rolling\nsun\nsuperscript\nsurprise\nswatchbook\nswimmer\nswimming-pool\nsynagogue\nsync\nsync-alt\nsyringe\ntable\ntable-tennis\ntablet\ntablet-alt\ntablets\ntachometer-alt\ntag\ntags\ntape\ntasks\ntaxi\nteeth\nteeth-open\nterminal\ntext-height\ntext-width\nth\nth-large\nth-list\ntheater-masks\nthermometer\nthermometer-empty\nthermometer-full\nthermometer-half\nthermometer-quarter\nthermometer-three-quarters\nthumbs-down\nthumbs-up\nthumbtack\nticket-alt\ntimes\ntimes-circle\ntint\ntint-slash\ntired\ntoggle-off\ntoggle-on\ntoolbox\ntooth\ntorah\ntorii-gate\ntrademark\ntraffic-light\ntrain\ntransgender\ntransgender-alt\ntrash\ntrash-alt\ntree\ntrophy\ntruck\ntruck-loading\ntruck-monster\ntruck-moving\ntruck-pickup\ntshirt\ntty\ntv\numbrella\numbrella-beach\nunderline\nundo\nundo-alt\nuniversal-access\nuniversity\nunlink\nunlock\nunlock-alt\nupload\nuser\nuser-alt\nuser-alt-slash\nuser-astronaut\nuser-check\nuser-circle\nuser-clock\nuser-cog\nuser-edit\nuser-friends\nuser-graduate\nuser-lock\nuser-md\nuser-minus\nuser-ninja\nuser-plus\nuser-secret\nuser-shield\nuser-slash\nuser-tag\nuser-tie\nuser-times\nusers\nusers-cog\nutensil-spoon\nutensils\nvector-square\nvenus\nvenus-double\nvenus-mars\nvial\nvials\nvideo\nvideo-slash\nvihara\nvolleyball-ball\nvolume-down\nvolume-off\nvolume-up\nwalking\nwallet\nwarehouse\nweight\nweight-hanging\nwheelchair\nwifi\nwindow-close\nwindow-maximize\nwindow-minimize\nwindow-restore\nwine-glass\nwine-glass-alt\nwon-sign\nwrench\nx-ray\nyen-sign\nyin-yang\n```\n\n\u003c/details\u003e\n\n#### Line 4 _(Optional)_\nLine 4 _(optionally)_ specifies what type of input your `App` can receive from the `iOS` or `iPadOS` `Share Sheet`.\n\n```javascript\n// share-sheet-inputs: plain-text, url, file-url, image;\n```\n\n- If Line 4 is ___provided___, your `App` will appear in `Share Sheet`.\n- If Line 4 is ___omitted___, your `App` will __NOT__ appear in `Share Sheet`.\n\nThe possible types are:\n\n- `plain-text`\n- `url`\n- `file-url`\n- `image`\n\n... and they are provided as a single type:\n\n```javascript\n// share-sheet-inputs: plain-text;\n```\n\n... or as a comma-and-space (`, `) separated list:\n\n```javascript\n// share-sheet-inputs: plain-text, url, file-url, image;\n```\n\n... terminated with a semicolon (`;`).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjimmy-zhening-luo%2Fscriptable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjimmy-zhening-luo%2Fscriptable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjimmy-zhening-luo%2Fscriptable/lists"}