Scan with your iPhone to install
Preview
Simple counter for 1 V 1 games like table tennis or tic tac toe...
...and much more!
Just add names and then click on name that win.
Features:
Automaticly save to Files
What's New
Version 2.1
New EDIT option, bug fixes
What it does
136 actions-
Create Folder
-
Get File
-
Set VariableCounter
-
If
-
Get My Shortcuts
-
If
-
Dictionary
-
Run ShortcutSwing Updater
-
If
-
Text
-
Choose from Menu…
-
Choose from MenuContinue
-
Choose from MenuNew counting
-
Delete Files
-
Run ShortcutCounter
-
Stop This Shortcut
-
Choose from MenuDelete
-
Delete Files
-
Stop This Shortcut
-
If
-
If
-
Show AlertNo configuration
-
Repeat
-
Set VariableName
-
Ask for InputPlease, enter name of person n.…:
-
Set VariableName
-
Repeat
-
Get Dictionary Value
-
If
-
Text
-
Ask for Input…
-
Set VariableName
-
Set Dictionary Value
-
Set VariableCounter
-
Save File
-
If
-
Text
-
If
-
Nothing
-
Choose from Menu… person…
-
Choose from MenuAdd person
-
Choose from MenuDone
-
If
-
Show NotificationThere will be only one person...
-
Choose from Menu
-
Choose from MenuYes, I’m sure
-
Run ShortcutCounter 5
-
Stop This Shortcut
-
Choose from MenuNo, add more
-
If
-
Run ShortcutCounter 5
-
Stop This Shortcut
-
Show NotificationTo start, re-open the shortcut.
-
Stop This Shortcut
-
Repeat with Each
-
Get Dictionary Value
-
Text
-
Add to Variable
-
Get Dictionary from Input
-
If
-
Get Dictionary Value
-
If
-
Set VariableMenu
-
Text
-
Add to Variable
-
Choose from List
-
Set VariableChoosenMenuItem
-
If
-
Text
-
Set VariableEditMenu
-
Add to Variable
-
Text
-
Add to Variable
-
Choose from List
-
Set VariableChoosenEditMenuItem
-
If
-
Repeat
-
Set VariableName
-
Count
-
Calculate
-
Ask for InputPlease, enter name of person n.…:
-
Set VariableName
-
Repeat
-
Get Dictionary Value
-
If
-
Text
-
Ask for Input…
-
Set VariableName
-
Set Dictionary Value
-
Set VariableCounter
-
Save File
-
Choose from Menu… persons
-
Choose from MenuAdd person
-
Choose from MenuDone and continue
-
Run ShortcutCounter
-
Stop This Shortcut
-
Show NotificationTo start, re-open the shortcut.
-
Stop This Shortcut
-
If
-
Run ShortcutCounter
-
Stop This Shortcut
-
Replace Text
-
Get Dictionary Value
-
If
-
Show NotificationFile doesn't contains selected item.
-
Stop This Shortcut
-
Text
-
If
-
Show NotificationUnexpected fault.
-
Ask for Input…:
-
If
-
Set Dictionary Value
-
If
-
Replace Text
-
If
-
Replace Text
-
If
-
Replace Text
-
If
-
Replace Text
-
If
-
Show NotificationUnexpected fault.
-
Set VariableCounter
-
Save File
-
Dictionary
-
Run ShortcutCounter
-
If
-
Replace Text
-
Get Dictionary Value
-
If
-
Show NotificationFile doesn't contains selected item.
-
Stop This Shortcut
-
Calculate
-
Set Dictionary Value
-
Save File
-
Run ShortcutCounter 5
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'
#include 'actions/shortcuts'
#include 'actions/documents'
#define color green
#define glyph circledPi
createFolder("counter")
getFile("counter/counter.json", false)
@Counter
if !ShortcutInput {
const MojeZkratky = getShortcuts()
if MojeZkratky['Name'] contains "Swing Updater" {
const Slovnk = {
"Name": "Counter",
"RH ID": "7322",
"Version": "1.1"
}
run("Swing Updater", Slovnk)
}
if @Counter {
menu {
item "Continue":
item "New counting":
deleteFiles(@Counter)
runSelf()
stop()
item "Delete":
deleteFiles(@Counter)
stop()
}
}
}
if !@Counter {
if !ShortcutInput {
alert("Please, set-up names.", "No configuration")
}
repeat _ for 20 {
@Name = nil
prompt("Please, enter name of person n.{@RepeatIndex}:")
@Name
repeat _ for 50 {
const HodnotaZeSlovnku = getValue(@Counter, @Name)
if HodnotaZeSlovnku {
prompt()
@Name
}
}
setValue(@Counter, @Name, "0")
@Counter
saveFile("counter/counter.json", @Counter, true)
if @RepeatIndex > 1 {
} else {
}
menu "{@RepeatIndex} person{}" {
item "Add person":
item "Done":
if @RepeatIndex <= 1 {
showNotification("There will be only one person...", "Are you sure?")
menu "" {
item "Yes, I’m sure":
runSelf()
stop()
item "No, add more":
}
} else {
runSelf()
stop()
}
}
}
showNotification("To start, re-open the shortcut.", "Too much persons")
stop()
}
for _ in @Counter {
@RawMenu += "{@RepeatItem}: {}"
}
const Slovnk1 = getDictionary(ShortcutInput)
if Slovnk1['ChoosenMenuItem'] {
getValue(Slovnk1, "ChoosenMenuItem")
} else {
@Menu = @RawMenu
@Menu += "EDIT"
chooseFromList(@Menu)
}
@ChoosenMenuItem
if @ChoosenMenuItem == "EDIT" {
@EditMenu = "Add person(s)"
@EditMenu = @RawMenu
@EditMenu += "← Back"
chooseFromList(@EditMenu, "Choose:")
@ChoosenEditMenuItem
if @ChoosenEditMenuItem == "Add person(s)" {
repeat _ for 20 {
@Name = nil
const Poet = count(@Counter)
prompt("Please, enter name of person n.{}:")
@Name
repeat _ for 50 {
const HodnotaZeSlovnku1 = getValue(@Counter, @Name)
if HodnotaZeSlovnku1 {
prompt()
@Name
}
}
setValue(@Counter, @Name, "0")
@Counter
saveFile("counter/counter.json", @Counter, true)
menu "{} persons" {
item "Add person":
item "Done and continue":
runSelf()
stop()
}
}
showNotification("To start, re-open the shortcut.", "Too much persons")
stop()
}
if @ChoosenEditMenuItem == "← Back" {
runSelf()
stop()
}
replaceText(": (\d+)$", "", false, true)
const HodnotaZeSlovnku2 = getValue(@Counter)
if !HodnotaZeSlovnku2 {
showNotification("File doesn't contains selected item.", "Error", HodnotaZeSlovnku2)
stop()
}
const Text = "{}: {HodnotaZeSlovnku2}"
if Text != {
showNotification("Unexpected fault.", "Error")
}
const PijatVstup = prompt("{}:", "Number")
if PijatVstup {
setValue(@Counter, PijatVstup)
} else {
const AktualizovanText = replaceText("\"{}\":{HodnotaZeSlovnku2},", "", @Counter)
if AktualizovanText == @Counter {
const AktualizovanText1 = replaceText("\"{}\":{HodnotaZeSlovnku2}", "", @Counter)
if AktualizovanText1 == @Counter {
const AktualizovanText2 = replaceText("\"{}\":\"{HodnotaZeSlovnku2}\",", "", @Counter, true)
if AktualizovanText2 == @Counter {
const AktualizovanText3 = replaceText("\"{}\":\"{HodnotaZeSlovnku2}\"", "", @Counter, true)
if AktualizovanText3 == @Counter {
showNotification("Unexpected fault.", "Error")
}
}
}
}
}
@Counter
saveFile("counter/counter.json", @Counter, true)
const Slovnk2 = {
"ChoosenMenuItem": "EDIT"
}
runSelf(Slovnk2)
} else {
replaceText(": (\d+)$", "", false, true)
const HodnotaZeSlovnku3 = getValue(@Counter)
if !HodnotaZeSlovnku3 {
showNotification("File doesn't contains selected item.", "Error")
stop()
}
const Slovnk3 = setValue(@Counter)
saveFile("counter/counter.json", Slovnk3, true)
runSelf()
}
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 kuba799
You Might Also Like
Advertisement