Created
August 19, 2020 19:40
-
-
Save 0507spc/85ac637e6f46c466c47332a55a6411f4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// 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