Action
Gym Thing Capture
Steps
-
script
//Gym tracker // Prompt for gym information var p = Prompt.create(); p.title = "Enter Gym Info"; p.message = "Enter details today" p.addTextField("weight", "Weight Lbs", "",{"keyboard":"numberPad"}); p.addTextField("elliptcal", "Elliptcal", "",{"keyboard": "numberPad"}); p.addTextField("spinbike", "Spin Bike", "", {"keyboard":"numberPad"}); p.addButton("Go"); var con = p.show(); if (con) { // Get values from prompt step var weight = "Weight Lbs: " + p.fieldValues["weight"]; var weightKG = "Weight KG: " + p.fieldValues["weight"] * .454; var elliptcal = "Elliptcal: " + p.fieldValues["elliptcal"]; var spinbike = "Spin Bike: " + p.fieldValues["spinbike"]; // Create Draft var d = Draft.create(); d.content = "Gym Info" + "\t" + weight + "\t" + weightKG + "\t" + elliptcal + "\t" + spinbike; d.update(); app.queueAction(Action.find("Gym Thing Post"), d); editor.load(d); } else { context.cancel(); }
Options
-
After Success Default Notification Info Log Level Info
Items available in the Drafts Directory are uploaded by community members. Use appropriate caution reviewing downloaded items before use.