Scan with your iPhone to install
Battery cycle
What's New
Version 1.0
First release
What it does
13 actions-
If
-
Show Result
-
Stop This Shortcut
-
If
-
If
-
Show Result
-
Stop This Shortcut
-
Set Name
-
Get Text from Input
-
Match Text
-
Match Text
-
Get Device Details
-
Show Result
View as code
Every action of this Shortcut written out as Cherri, a programming language for Shortcuts. Great for learning how it works.
#include 'actions/text'
#define color green
#define glyph battery
if !ShortcutInput {
show("No \"log-aggregated\" file found. Go to Settings > Privacy > Analytics & Improvements > Analytics Data. ")
stop()
} else {
if ShortcutInput !contains "log-aggregated" {
show("No \"log-aggregated\" file found. Go to Settings > Privacy > Analytics & Improvements > Analytics Data. ")
stop()
}
}
const RenamedItem = setName(ShortcutInput, "{ShortcutInput['Name']}.txt")
getText(RenamedItem)
containsText(, "(?<=BatteryCycleCount<\/key>).*\n.*.\d+")
containsText(, "\d+")
getDeviceDetail("Device Model")
show("Your {} battery cycle count is: {} cycles.")
Open in Cherri Playground
Decompiled with cherri 2.3.0 (GPL-2.0). May need small fixes before it compiles.
Ratings & Reviews
Write a Review–
out of 5
★★★★★
★★★★
★★★
★★
★
0 ratings
No reviews yet. Be the first to share what you think!
Advertisement
More by outlander-2007
You Might Also Like
Advertisement