Skip to content

Instantly share code, notes, and snippets.

@0507spc
Created August 19, 2020 19:40
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 0507spc/85ac637e6f46c466c47332a55a6411f4 to your computer and use it in GitHub Desktop.
Save 0507spc/85ac637e6f46c466c47332a55a6411f4 to your computer and use it in GitHub Desktop.
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: black; icon-glyph: user-md;
var fm = FileManager.iCloud()
var imgLocation = fm.bookmarkedPath("WeightTracker.png")
var imgToShow = fm.readImage(imgLocation)
if (config.runsInWidget) {
// create and show widget
let widget = createWidget("Weight Tracker", imgToShow)
Script.setWidget(widget)
Script.complete()
} else {
//Safari.open(imgToShow)
}
function createWidget(title, img) {
let w = new ListWidget()
w.backgroundColor = new Color("#1A1A1A")
w.centerAlignContent()
let image = w.addImage(img);
image.centerAlignImage();
image.imageSize = new Size(300,1400)
return w
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment