Timer and Stopwatch Launcher
You will be asked for text input in the following syntax ('#' is set by default to be deleted as needed):
Input digits and anything else as separators:
# <minute> [second]
([second] is optional)
<hour> [minute]
([minute] is optional)
Input any length of text excluding digits:
# <text length = minute>
<text length = hour>
Leave it blank for stopwatch. ('#' is optional)
Examples:
#hello 5-minute timer
got it 6-hour timer
#3 3-minute timer
2 15 2-hour-15-minute timer
# 6 + 7 = 13 6-minute-7-second timer
# starts the stopwatch
Nouveautés
Changed the prompt.
Ce qu’il fait
31 actions-
Text
-
Set VariableNullText
-
Text
-
Ask for Input…
-
Match Text
-
Get Group from Matched Text
-
If
-
Text
-
If
-
Text
-
Set VariableMinHourFactor
-
Get Group from Matched Text
-
Set VariableOnes
-
If
-
Get Group from Matched Text
-
Count
-
If
-
Calculate
-
Start Timer
-
Open Tabcom.apple.mobiletimer
-
If
-
Start Stopwatchcom.apple.mobiletimer
-
Open Tabcom.apple.mobiletimer
-
If
-
Get Group from Matched Text
-
If
-
Text
-
Set VariableSixtieths
-
Calculate Expression
-
Start Timer
-
Open Tabcom.apple.mobiletimer
Afficher en tant que code
Chaque action de ce raccourci écrite en Cherri, un langage de programmation pour Raccourcis. Idéal pour comprendre son fonctionnement.
#include 'actions/text'
#define color teal
#define glyph timer
@NullText = "nil"
prompt(, "Text", false)
const Matches = containsText(, "^(#?)([^0-9]*)([0-9]*)[^0-9]*([0-9]*)")
const Text = getMatchGroup(Matches, 1)
if Text == "#" {
} else {
}
@MinHourFactor = "60"
getMatchGroup(Matches, 3)
@Ones
if @Ones == @NullText || !@Ones {
const Text1 = getMatchGroup(Matches, 2)
const Count = count(Text1, "Characters")
if Count > 0 {
startTimer()
rawAction("com.apple.mobiletimer.OpenTab", {
"AppIntentDescriptor": "",
"tab": "timer"
})
} else {
rawAction("com.apple.mobiletimer.StartStopwatchIntent", {
"AppIntentDescriptor": ""
})
rawAction("com.apple.mobiletimer.OpenTab", {
"AppIntentDescriptor": "",
"tab": "stopwatch"
})
}
} else {
const Text2 = getMatchGroup(Matches, 4)
if Text2 == @NullText {
}
@Sixtieths = "0"
startTimer()
rawAction("com.apple.mobiletimer.OpenTab", {
"AppIntentDescriptor": "",
"tab": "timer"
})
}
Notes et avis
Écrire un avisAucun avis pour le moment. Sois le premier à partager ton avis !