ShareShortcuts

Commander v1

Commands for your iPhone/iPad

turtle
Fazer fork de “Commander v1”

Criou algo novo a partir deste atalho? Compartilhe como uma derivação: ela se torna um atalho seu, que você gerencia, e as duas páginas têm links entre si para que turtle receba o crédito.

  1. 1Obtenha o atalho e altere-o no app Atalhos. Dê a ele um nome próprio.
  2. 2Compartilhe pelo app Atalhos e copie o link do iCloud.
  3. 3Volte aqui, cole o link e descreva o que mudou, por exemplo: “Adicionei uma etapa que usa a Apple Intelligence para personalizar o texto.”
Downloads
53K
Salvo
3
Ações
77
Categoria
Utilities
Versão
1.1
Idioma
EN

Commands for your iPhone/iPad.

Novidades

Versão 1.1

Added API.

Histórico de versões
1.1 15 de jan de 2021

Added API.

1.0 15 de jan de 2021

First release

O que ele faz

77 ações
  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

Ver como código
Beta

Todas as ações deste atalho escritas em Cherri, uma linguagem de programação para o app Atalhos. Ótimo para aprender como ele funciona.

#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()
				}
			}
		}
	}
}
Abrir no Cherri Playground Descompilado com cherri 2.3.0 (GPL-2.0). Pode precisar de pequenos ajustes antes de compilar.

Avaliações e comentários

Escrever uma avaliação
–
de 5
★★★★★
★★★★
★★★
★★
★
0 ratings

Ainda não há avaliações. Seja o primeiro a compartilhar o que você pensa!

Publicidade

Mais de turtle

Ver tudo

Você também pode gostar

Ver tudo
Publicidade