You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 8, 2024. It is now read-only.
Inspired by this, I'm currently working on a JavaScript to iOS shortcuts transpiler. I've gotten most of the parsing done and I'm now working on the transpiler portion of the project. My intention is to utilize this library since I really appreciate the effort you have put in it and what shape it's taking.
One question comes to mind however, how are variables handled? Most actions on iOS are able to work with either magic variables or actual variables as parameters (not input). How are these or how will these be available through this package?
The text was updated successfully, but these errors were encountered:
At the moment, you can only use magic variables (action outputs) in strings and it's done via JS template strings and the withVariables tag function: take a look to Minimal Example to see how it works.
// We'll use this later to reference the output of a calculationletcalcId;// Define our list of actionsconstactions=[number({number: 42,}),calculate({operand: 3,operation: '/',},(id)=>{// We'll use this again in a momentcalcId=id;}),showResult({/** * We can use the result of the calculation in this Shortcuts's input * by passing the string to the 'withVariables' tag function */text: withVariables`Total is ${calcId}!`,}),];
Pull request #8 adds support for actual variables too, but it's not currently merged.
Future releases may slightly change how variables are handled.
We’re still pre v1, and there were a few things that I’d not considered when designing the current implementation of variables. Because of this, things might well change in the future. There’s a bit more discussion around this topic in #4.
Inspired by this, I'm currently working on a JavaScript to iOS shortcuts transpiler. I've gotten most of the parsing done and I'm now working on the transpiler portion of the project. My intention is to utilize this library since I really appreciate the effort you have put in it and what shape it's taking.
One question comes to mind however, how are variables handled? Most actions on iOS are able to work with either magic variables or actual variables as parameters (not input). How are these or how will these be available through this package?
The text was updated successfully, but these errors were encountered: