Shortcuts JS enables you to create Shortcuts using JavaScript, allowing you to build complex Shortcuts more quickly and easily than ever before.
If you want to help Shortcuts JS improve, please consider contributing to the project. You don't even need to be a developer to help!
If you've never contributed to an Open Source project before, then this is a great place to start! We're a very welcoming community and are more than happy to help you get started.
Write some code below to create a Shortcut, or download the generated example.
xxxxxxxxxx
// We'll use this later to reference the output of a calculation
let calcVar = actionOutput();
// Define a list of actions
const actions = [
comment({
text: 'Hello, world!',
}),
number({
number: 42,
}),
calculate({
operand: 3,
operation: '/',
}, calcVar),
showResult({
// Use the Magic Variable
text: withVariables`Total is ${calcVar}!`,
}),
];
Download the Shortcut, then AirDrop it to your iPhone or iPad. The Shortcut will then be automatically imported into the Shortcuts app.
Hi! Thanks for checking out Shortcuts JS. I built this library out of frustration with Apple's Shortcuts app, as I found complex Shortcuts were difficult to manage using its drag-and-drop interface. I wanted to write Shortcuts the same way I write code, so I created Shortcuts JS.
Thank you to everyone who has given their time to help improve Shortcuts JS. Whether that's reporting a bug, requesting a feature, suggesting an action, or submitting a Pull Request, you've all played a part in making Shortcuts JS better. Special thanks goes to those developers who've had Pull Requests merged into the library.