ShareShortcuts

Commander v1

Commands for your iPhone/iPad

turtle
Создать форк «Commander v1»

Создали что-то новое на основе этой команды? Поделитесь ей как форком: она станет вашей собственной командой, которой вы управляете, а обе страницы будут ссылаться друг на друга, чтобы turtle получил(а) признание.

  1. 1Получите команду и измените её в приложении «Быстрые команды». Дайте ей собственное название.
  2. 2Поделись ею из приложения «Быстрые команды» и скопируй ссылку iCloud.
  3. 3Вернись сюда, вставь ссылку и опиши, что изменилось, например: «Добавлен шаг, который использует Apple Intelligence для персонализации текста».
Загрузки
53K
Сохранено
3
Действия
77
Категория
Utilities
Версия
1.1
Язык
EN

Commands for your iPhone/iPad.

Что нового

Версия 1.1

Added API.

История версий
1.1 15 янв 2021 г.

Added API.

1.0 15 янв 2021 г.

First release

Что делает

Действий: 77
  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

Посмотреть как код
Бета

Все действия этой команды, записанные на Cherri — языке программирования для приложения «Быстрые команды». Отлично подходит, чтобы разобраться, как она работает.

#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()
				}
			}
		}
	}
}
Открыть в Cherri Playground Декомпилировано с помощью cherri 2.3.0 (GPL-2.0). Перед компиляцией могут понадобиться небольшие исправления.

Оценки и отзывы

Написать отзыв
–
из 5
★★★★★
★★★★
★★★
★★
★
0 ratings

Пока нет отзывов. Поделись мнением первым!

Реклама

Ещё от turtle

См. все

Вам также может понравиться

См. все
Реклама