Log Water
Did you know that approximately 80% of Americans don’t get enough water every day?
gutlessbubble96Scan med din iPhone for at installere
Forhåndsvisning
Did you know that approximately 80% of Americans don’t get enough water every day? Time to do something about it! Set a goal and the app will let you know how close you are to smashing it! All entries are saved to your Apple Health app.
Nyheder
Version 1.2
Streamlined file system creation by 2 lines. Also, fixed duplicate / empty data entries in Apple Health
Hvad den gør
48 handlinger-
CommentWelcome to water log created by GutlessBubble96 Version log: 1.02 - streamlined file system creation by 2 lines. 1.01 - fixed duplicate / empty data entries 1.0 - original version
-
CommentCreates file system for water goal (leaves it alone if one already exists)
-
Get File
-
If
-
Set VariableWater goal
-
Nothing
-
If
-
Create Folder
-
Ask for InputWhat is your water goal in oz? (Recommended amount is half of body weight in oz)
-
Set VariableWater goal
-
Save File
-
List
-
Choose from List
-
If
-
Ask for InputWhat is your water goal in oz? (Recommended amount is half of body weight in oz)
-
Set VariableWater goal
-
Save File
-
List
-
Choose from List
-
If
-
Ask for InputHow many ounces did you drink?
-
If
-
Log Health Sample
-
If
-
If
-
Get Numbers from Input
-
If
-
Log Health Sample
-
If
-
Ask for InputHow many ounces did you drink?
-
If
-
Log Health Sample
-
Get Numbers from Input
-
If
-
Log Health Sample
-
If
-
Get File
-
Set VariableWater goal
-
Find Health Samples
-
Repeat with Each
-
Add to Variable
-
Get Numbers from Input
-
Calculate Statistics
-
Calculate
-
If
-
Show Alert
-
If
-
Show Alert
Vis som kode
Alle genvejens handlinger skrevet ud i Cherri, et programmeringssprog til genveje. Perfekt til at lære, hvordan den virker.
#include 'actions/documents'
#define color blue
#define glyph waterDrop
/*
Welcome to water log created by GutlessBubble96
Version log:
1.02 - streamlined file system creation by 2 lines.
1.01 - fixed duplicate / empty data entries
1.0 - original version
*/
// Creates file system for water goal (leaves it alone if one already exists)
const File = getFileFromFolder(, "Water/watergoal.txt", false)
if File {
@WaterGoal = File
} else {
createFolder("Water")
prompt("What is your water goal in oz? (Recommended amount is half of body weight in oz)", "Number")
@WaterGoal
saveFile("Water/watergoal.txt", @WaterGoal, true)
}
const List = list("8", "12", "16", "20", "24", "Other", "Edit Goal")
const OuncesWater = chooseFromList(List, "How many fluid ounces of water did you drink? Your current goal is: {@WaterGoal} oz ", false)
if OuncesWater == "Edit Goal" {
prompt("What is your water goal in oz? (Recommended amount is half of body weight in oz)", "Number")
@WaterGoal
saveFile("Water/watergoal.txt", @WaterGoal, true)
const List1 = list("8", "12", "16", "20", "24", "Other")
const OuncesWater1 = chooseFromList(List1, "How many fluid ounces of water did you drink? Your current goal is: {@WaterGoal} oz ", false)
if OuncesWater1 == OuncesWater1 {
const ProvidedInput = prompt("How many ounces did you drink?", "Number")
if ProvidedInput {
rawAction("is.workflow.actions.health.quantity.log", {
"WFQuantitySampleAdditionalQuantity": "",
"WFQuantitySampleDate": "{CurrentDate}",
"WFQuantitySampleQuantity": "",
"WFQuantitySampleType": "Water"
})
} else {
}
} else {
const Numbers = getNumbers(OuncesWater1)
if Numbers {
rawAction("is.workflow.actions.health.quantity.log", {
"WFQuantitySampleAdditionalQuantity": "",
"WFQuantitySampleDate": "{CurrentDate}",
"WFQuantitySampleQuantity": "",
"WFQuantitySampleType": "Water"
})
}
}
}
if OuncesWater == OuncesWater1 {
const ProvidedInput1 = prompt("How many ounces did you drink?", "Number")
if ProvidedInput1 {
rawAction("is.workflow.actions.health.quantity.log", {
"WFQuantitySampleDate": "{CurrentDate}",
"WFQuantitySampleQuantity": "",
"WFQuantitySampleType": "Water"
})
}
}
const Numbers1 = getNumbers(OuncesWater)
if Numbers1 > 0 {
rawAction("is.workflow.actions.health.quantity.log", {
"WFQuantitySampleAdditionalQuantity": "",
"WFQuantitySampleDate": "{CurrentDate}",
"WFQuantitySampleQuantity": "",
"WFQuantitySampleType": "Water"
})
} else {
}
getFile("Water/watergoal.txt", false)
@WaterGoal
rawAction("is.workflow.actions.filter.health.quantity", {
"WFContentItemFilter": "",
"WFContentItemLimitEnabled": false,
"WFContentItemSortOrder": "A to Z"
})
for _ in HealthSamples {
@TotalWater = @RepeatItem
}
getNumbers(@TotalWater)
const Sum = statistic("Sum", nil)
const CalculationResult = @WaterGoal - Sum
if CalculationResult > 0 {
confirm("{CalculationResult} Oz of water remaining. Keep it up!")
} else {
confirm("You met your daily water goal!!! 🎉\n\n{Sum}Oz of water today!")
}
Åbn i Cherri Playground
Dekompileret med cherri 2.3.0 (GPL-2.0). Kan kræve små rettelser, før den kan kompileres.
Bedømmelser og anmeldelser
Skriv en anmeldelse–
ud af 5
★★★★★
★★★★
★★★
★★
★
0 ratings
Ingen anmeldelser endnu. Vær den første!
Annonce
Mere fra gutlessbubble96
Du vil måske også kunne lide
Annonce