ShareShortcuts

MarkoScript

A programming language made using Shortcuts

marko2155
Fork “MarkoScript”

Built something new on top of this Shortcut? Share it as a fork: it becomes a Shortcut of your own, which you manage, and both pages link to each other so marko2155 gets credit.

  1. 1Get the Shortcut and change it in the Shortcuts app. Give it a name of its own.
  2. 2Share it from the Shortcuts app and copy the iCloud link.
  3. 3Come back here, paste the link and describe what is different, e.g. “Added a step that uses Apple Intelligence to personalise the text.”
Downloads
22K
Saved
0
Actions
35
Category
API
Version
1.0
Language
EN

A programming language made using Shortcuts

What's New

Version 1.0

First release

Version History
1.0 Jul 17, 2024

First release

What it does

35 actions
  1. Dictionary
  2. Select File
  3. Split Text
  4. Repeat with Each
  5. If
  6. Split Text
  7. Get Item from List
  8. Combine Text
  9. Show Result
  10. If
  11. If
  12. Split Text
  13. Get Item from List
  14. Set Variable
    bufferVariable
  15. Get Item from List
  16. Set Dictionary Value
  17. Set Variable
    bufferVariable
  18. If
  19. If
  20. Split Text
  21. Get Item from List
  22. Get Dictionary Value
  23. Combine Text
  24. Show Result
  25. If
  26. If
  27. Split Text
  28. Get Item from List
  29. Set Variable
    bufferVariable
  30. Get Item from List
  31. Combine Text
  32. Ask for Input
    …
  33. Set Dictionary Value
  34. Set Variable
    bufferVariable
  35. If

View as code
Beta

Every action of this Shortcut written out as Cherri, a programming language for Shortcuts. Great for learning how it works.

#include 'actions/documents'
#define color darkblue

const File = selectFile(false)
const SplitText = splitText(File, "
")

for _ in SplitText {
	if @RepeatItem beginsWith "echo" {
		const SplitText1 = splitText(@RepeatItem, " ")
		const ItemFromList = getListItems(SplitText1, 2, 0)
		joinText(ItemFromList, " ")
		show()
	} else {
		if @RepeatItem beginsWith "svar" {
			const SplitText2 = splitText(@RepeatItem, " ")
			getListItem(SplitText2, 2)
			@bufferVariable
			getListItem(SplitText2, 3)
			const Dictionary = setValue(Dictionary, @bufferVariable)
			@bufferVariable = nil
		} else {
			if @RepeatItem beginsWith "evar" {
				const SplitText3 = splitText(@RepeatItem, " ")
				getListItem(SplitText3, 2)
				const DictionaryValue = getValue(Dictionary)
				joinText(DictionaryValue, " ")
				show()
			} else {
				if @RepeatItem beginsWith "sinput" {
					const SplitText4 = splitText(@RepeatItem, " ")
					getListItem(SplitText4, 2)
					@bufferVariable
					const ItemFromList1 = getListItems(SplitText4, 3, 0)
					joinText(ItemFromList1, " ")
					prompt()
					const Dictionary1 = setValue(Dictionary1, @bufferVariable)
					@bufferVariable = nil
				} else {
				}
			}
		}
	}
}
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

You Might Also Like

See All
Advertisement