ShareShortcuts

Commander v1

Commands for your iPhone/iPad

turtle
Dupliquer « Commander v1 »

Tu as créé quelque chose de nouveau à partir de ce raccourci ? Partage-le comme version dérivée : il devient un raccourci à toi, que tu gères, et les deux pages renvoient l’une vers l’autre pour que turtle soit crédité.

  1. 1Obtenez le raccourci et modifiez-le dans l’app Raccourcis. Donnez-lui un nom bien à lui.
  2. 2Partage-le depuis l’app Raccourcis et copie le lien iCloud.
  3. 3Reviens ici, colle le lien et décris ce qui change, par exemple : « Ajout d’une étape qui utilise Apple Intelligence pour personnaliser le texte. »
Créer mon fork
Téléchargements
53K
Enregistré
3
Actions
77
Catégorie
Utilities
Version
1.1
Langue
EN

Commands for your iPhone/iPad.

Nouveautés

Version 1.1

Added API.

Historique des versions
1.1 15 janv. 2021

Added API.

1.0 15 janv. 2021

First release

Ce qu’il fait

77 actions
  1. Text
  2. Set Variable
    Help v1.1
  3. Text
  4. If
  5. Nothing
  6. If
  7. If
  8. Get File
  9. URL
    simplecuts.glitch.me/updates/commander.json
  10. Get Contents of URL
    …
  11. Get Text from Input
  12. Set Variable
    AutoUpdate
  13. If
  14. If
  15. If
  16. If
  17. Choose from Menu
    A commander update is available!
  18. Choose from Menu
    Install
  19. Get Dictionary Value
  20. Show Web Page
  21. Stop This Shortcut
  22. Choose from Menu
    Details
  23. Get Dictionary Value
  24. Get Dictionary Value
  25. Text
  26. Choose from Menu
    …
  27. Choose from Menu
    Install
  28. Get Dictionary Value
  29. Show Web Page
  30. Stop This Shortcut
  31. Choose from Menu
    Skip
  32. Save File
  33. Choose from Menu
    Skip
  34. Get Dictionary Value
  35. Save File
  36. If
  37. Set Variable
    invalidsyntax
  38. Show Alert
  39. Get Device Details
  40. If
  41. Show Alert
  42. Get Device Details
  43. If
  44. Split Text
  45. Get Item from List
  46. Get Text from Input
  47. If
  48. Ask for Input
    Commander on iOS …, …
  49. Set Variable
    Command-er
  50. If
  51. Replace Text
  52. Speak Text
  53. Run Shortcut
    Commander v1
  54. If
  55. If
  56. Get Contents of URL
    simplecuts.glitch.me/updates/commander.json
  57. Get Dictionary Value
  58. Open URLs
  59. Stop This Shortcut
  60. If
  61. If
  62. Show Alert
    Time
  63. Run Shortcut
    Commander v1
  64. If
  65. If
  66. Show Alert
    Date
  67. Run Shortcut
    Commander v1
  68. If
  69. If
  70. Show Result
  71. Run Shortcut
    Commander v1
  72. If
  73. If
  74. Replace Text
  75. Get File
  76. Stop This Shortcut
  77. Run Shortcut
    Commander v1

Afficher en tant que code
Bêta

Chaque action de ce raccourci écrite en Cherri, un langage de programmation pour Raccourcis. Idéal pour comprendre son fonctionnement.

#include 'actions/web'
#define color red
#define glyph documentFilled

@HelpV11 = "• Commander •\nsay - Says anything.\n(e.g. say Commander is the best!)\nupdate - If you enabled Manual Update, this command works.\nhelp - Heres what you are viewing.\ntime - Here's the time\ndate - Here's the date.\n\nEnd of Commander help list\n\nStart of Commander API list\nTo use Commander API, run this shortcut with input \\"Commander -(command)\\" and it will execute.\n\nNew commands in API only:\n- getfile (file path in /Shortcuts/)"
const updatescommander = "MANUAL"

if updatescommander contains "MANUAL" {
} else {
	if updatescommander contains "AUTO" {
		const File = getFileFromFolder(, "skipper.txt", false)
		url("simplecuts.glitch.me/updates/commander.json")
		const ContentsOfURL = downloadURL()
		getText(ContentsOfURL)
		@AutoUpdate
		if @AutoUpdate contains "1.1" {
		} else {
			if File {
			} else {
				menu "A commander update is available!" {
				item "Install":
					const DictionaryValue = getValue(@AutoUpdate, "URL")
					showWebpage(DictionaryValue)
					stop()
				item "Details":
					const DictionaryValue2 = getValue(@AutoUpdate, "NewVer")
					menu  {
					item "Install":
						const DictionaryValue1 = getValue(@AutoUpdate, "URL")
						showWebpage(DictionaryValue1)
						stop()
					item "Skip":
						saveFile("skipper.txt", DictionaryValue2, true)
					}
				item "Skip":
					const DictionaryValue3 = getValue(@AutoUpdate, "NewVer")
					saveFile("skipper.txt", DictionaryValue3, true)
				}
			}
		}
	} else {
		@invalidsyntax = updatescommander
		confirm("Invalid update syntax. Using manual instead.")
	}
}
const sysver = getDeviceDetail("System Version")

if sysver contains "12" {
	confirm("Shortcuts is too old. Please run on a newer version of iOS.")
}
const sysname = getDeviceDetail("Device Name")

if ShortcutInput {
	const SplitText = splitText(sysname, "Commander -")
	const ItemFromList = getListItem(SplitText, 2)
	getText(ItemFromList)
} else {
	prompt("Commander on iOS {sysver}, {sysname}")
}
@Commander

if @Commander contains "say" {
	replaceText("say ", "", @Commander)
	speak()
	runSelf()
} else {
	if @Commander contains "update" {
		const ContentsOfURL1 = downloadURL("simplecuts.glitch.me/updates/commander.json")
		const DictionaryValue4 = getValue(ContentsOfURL1, "URL")
		openURL(DictionaryValue4)
		stop()
	} else {
		if @Commander contains "time" {
			alert(CurrentDate, "Time")
			runSelf()
		} else {
			if @Commander contains "date" {
				alert(CurrentDate, "Date")
				runSelf()
			} else {
				if @Commander == "help" {
					show(@HelpV11)
					runSelf()
				} else {
					if @Commander contains "getfile" {
						replaceText("getfile ", "", @Commander)
						const File1 = getFile()
						stop()
					}
					runSelf()
				}
			}
		}
	}
}
Ouvrir dans Cherri Playground Décompilé avec cherri 2.3.0 (GPL-2.0). Quelques corrections peuvent être nécessaires avant la compilation.

Notes et avis

Écrire un avis
–
sur 5
★★★★★
★★★★
★★★
★★
★
0 ratings

Aucun avis pour le moment. Sois le premier à partager ton avis !

Publicité

Plus de turtle

Tout afficher

Ça pourrait aussi te plaire

Tout afficher
Publicité