Skip to content

Latest commit

 

History

History
55 lines (39 loc) · 1.05 KB

README.md

File metadata and controls

55 lines (39 loc) · 1.05 KB

Scriptable Utils

Utility libraries for Scriptable.

XML2UI

Template syntax

All rules almost follow the Scriptable Docs.

  • Element tag name support lowercase or capitalize first letter
  • Supports 6 prototypes for global
    • textColor
    • font
    • textOpacity
    • shadowColor
    • shadowRadius
    • shadowOffset
  • Support conditional:
    <Text if="2 > 1" />

Examples

Widget

const XML2UI = importModule("XML2UI");

const fm = FileManager.iCloud();
const templatePath = fm.joinPath(fm.documentsDirectory(), "template.html");
await fm.downloadFileFromiCloud(templatePath);
const template = fm.readString(templatePath);

const widgetXML = new XML2UI.WidgetXML(template, { debug: true });
const widget = widgetXML.create();

if (config.runsInWidget) {
  Script.setWidget(widget);
} else if (config.runsWithSiri) {
} else {
  await widget.presentMedium();
}

Script.complete();

template

widget

UI

No implementation yet.