ShareShortcuts

View Battery Cycle

Battery cycle

outlander-2007
Fork “View Battery Cycle”

Built something new on top of this Shortcut? Share it as a fork: it becomes a Shortcut of your own, which you manage, and both pages link to each other so outlander-2007 gets credit.

  1. 1Get the Shortcut and change it in the Shortcuts app. Give it a name of its own.
  2. 2Share it from the Shortcuts app and copy the iCloud link.
  3. 3Come back here, paste the link and describe what is different, e.g. “Added a step that uses Apple Intelligence to personalise the text.”
Downloads
96K
Saved
2
Actions
13
Category
API
Version
1.0
Language
EN

Battery cycle

What's New

Version 1.0

First release

Version History
1.0 Jan 20, 2022

First release

What it does

13 actions
  1. If
  2. Show Result
  3. Stop This Shortcut
  4. If
  5. If
  6. Show Result
  7. Stop This Shortcut
  8. Set Name
  9. Get Text from Input
  10. Match Text
  11. Match Text
  12. Get Device Details
  13. Show Result

View as code
Beta

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

See All

You Might Also Like

See All
Advertisement