Last active
October 9, 2020 03:17
-
-
Save cassmtnr/6dd964587c4846a0a937e53391e8d91c to your computer and use it in GitHub Desktop.
Scriptable quantity downloads
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let quantity = "500.000"; | |
let widget = new ListWidget(); | |
let widgetInputRAW = args.widgetParameter; | |
if (widgetInputRAW) { | |
try { | |
widgetInputRAW.toString(); | |
if (widgetInputRAW.toString() !== "") { | |
quantity = widgetInputRAW.toString(); | |
} | |
} catch (e) { | |
throw new Error("Please long press the widget and add a parameter."); | |
} | |
} | |
widget.backgroundColor = new Color("#FEFFA9"); | |
let qt = widget.addText(quantity); | |
qt.font = Font.semiboldSystemFont(24); | |
qt.textColor = Color.black(); | |
const label = "DOWNLOADS!!"; | |
let text = widget.addText(label); | |
text.font = Font.semiboldSystemFont(16); | |
text.textColor = Color.black(); | |
Script.setWidget(widget); | |
widget.presentSmall(); | |
Script.complete(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment