ShareShortcuts

Morse Code Converter

Usage: - Converts between Morse code and texts without internet

arirafiq
Fork “Morse Code Converter”

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 arirafiq 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
54K
Saved
1
Actions
41
Category
Utilities
Version
1.1
Language
EN

Preview

Usage: - Converts between Morse code and texts without internet. - You can copy the result to your clipboard.

What's New

Version 1.1

Link fixed.

Version History
1.1 Mar 24, 2021

Link fixed.

1.0 Jan 16, 2021

First release

What it does

41 actions
  1. Comment
    Author: Ari R. Abdulla Usage: - Converts between Morse code and texts without internet. - You can copy the result to your clipboard.
  2. Choose from Menu
    Which converter do you want?
  3. Choose from Menu
    Text to Morse Code
  4. Text
  5. Get Dictionary from Input
  6. Set Variable
    dict
  7. Ask for Input
    Enter your text?
  8. Get Text from Input
  9. Change Case
  10. Split Text
  11. Set Variable
    In
  12. Repeat with Each
  13. If
  14. Get Dictionary Value
  15. Combine Text
  16. Set Variable
    Result
  17. Choose from Menu
    Your Morse Code: …
  18. Choose from Menu
    Copy
  19. Copy to Clipboard
  20. Choose from Menu
    Exit
  21. Stop This Shortcut
  22. Choose from Menu
    Morse Code to Text
  23. Text
  24. Get Dictionary from Input
  25. Set Variable
    dictt
  26. Ask for Input
    Enter your morse code?
  27. Get Text from Input
  28. Split Text
  29. Set Variable
    Inn
  30. Repeat with Each
  31. If
  32. Get Dictionary Value
  33. Combine Text
  34. Change Case
  35. Set Variable
    Final
  36. Set Variable
    Resultt
  37. Choose from Menu
    Your Text: …
  38. Choose from Menu
    Copy
  39. Copy to Clipboard
  40. Choose from Menu
    Exit
  41. Stop This Shortcut

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/text'
#define color yellow

/*
Author: Ari R. Abdulla
Usage:
- Converts between Morse code and texts without internet.
- You can copy the result to your clipboard.
*/

menu "Which converter do you want?" {
item "Text to Morse Code":
	const Text = "{\n  \\"0\\": \\"-----\\",\n  \\"1\\": \\".----\\",\n  \\"2\\": \\"..---\\",\n  \\"3\\": \\"...--\\",\n  \\"4\\": \\"....-\\",\n  \\"5\\": \\".....\\",\n  \\"6\\": \\"-....\\",\n  \\"7\\": \\"--...\\",\n  \\"8\\": \\"---..\\",\n  \\"9\\": \\"----.\\",\n  \\"a\\": \\".-\\",\n  \\"b\\": \\"-...\\",\n  \\"c\\": \\"-.-.\\",\n  \\"d\\": \\"-..\\",\n  \\"e\\": \\".\\",\n  \\"f\\": \\"..-.\\",\n  \\"g\\": \\"--.\\",\n  \\"h\\": \\"....\\",\n  \\"i\\": \\"..\\",\n  \\"j\\": \\".---\\",\n  \\"k\\": \\"-.-\\",\n  \\"l\\": \\".-..\\",\n  \\"m\\": \\"--\\",\n  \\"n\\": \\"-.\\",\n  \\"o\\": \\"---\\",\n  \\"p\\": \\".--.\\",\n  \\"q\\": \\"--.-\\",\n  \\"r\\": \\".-.\\",\n  \\"s\\": \\"...\\",\n  \\"t\\": \\"-\\",\n  \\"u\\": \\"..-\\",\n  \\"v\\": \\"...-\\",\n  \\"w\\": \\".--\\",\n  \\"x\\": \\"-..-\\",\n  \\"y\\": \\"-.--\\",\n  \\"z\\": \\"--..\\",\n  \\".\\": \\".-.-.-\\",\n  \\",\\": \\"--..--\\",\n  \\"?\\": \\"..--..\\",\n  \\"!\\": \\"-.-.--\\",\n  \\"-\\": \\"-....-\\",\n  \\"/\\": \\"-..-.\\",\n  \\"@\\": \\".--.-.\\",\n  \\"(\\": \\"-.--.\\",\n  \\")\\": \\"-.--.-\\",\n  \\" \\": \\"/\\"\n}"
	getDictionary(Text)
	@dict
	const ProvidedInput = prompt("Enter your text?")
	const Text1 = getText(ProvidedInput)
	const UpdatedText = uppercase(Text1)
	splitText(UpdatedText, "")
	@In
	for _ in @In {
		if @RepeatItem == "" {
		}
	}
	joinText(RepeatResults, " ")
	@Result
	menu "Your Morse Code: {@Result} " {
	item "Copy":
		setClipboard(@Result)
	item "Exit":
		stop()
	}
item "Morse Code to Text":
	const Text2 = "{\n  \\"-----\\": \\"0\\",\n  \\".----\\": \\"1\\",\n  \\"..---\\": \\"2\\",\n  \\"...--\\": \\"3\\",\n  \\"....-\\": \\"4\\",\n  \\".....\\": \\"5\\",\n  \\"-....\\": \\"6\\",\n  \\"--...\\": \\"7\\",\n  \\"---..\\": \\"8\\",\n  \\"----.\\": \\"9\\",\n  \\".-\\": \\"a\\",\n  \\"-...\\": \\"b\\",\n  \\"-.-.\\": \\"c\\",\n  \\"-..\\": \\"d\\",\n  \\".\\": \\"e\\",\n  \\"..-.\\": \\"f\\",\n  \\"--.\\": \\"g\\",\n  \\"....\\": \\"h\\",\n  \\"..\\": \\"i\\",\n  \\".---\\": \\"j\\",\n  \\"-.-\\": \\"k\\",\n  \\".-..\\": \\"l\\",\n  \\"--\\": \\"m\\",\n  \\"-.\\": \\"n\\",\n  \\"---\\": \\"o\\",\n  \\".--.\\": \\"p\\",\n  \\"--.-\\": \\"q\\",\n  \\".-.\\": \\"r\\",\n  \\"...\\": \\"s\\",\n  \\"-\\": \\"t\\",\n  \\"..-\\": \\"u\\",\n  \\"...-\\": \\"v\\",\n  \\".--\\": \\"w\\",\n  \\"-..-\\": \\"x\\",\n  \\"-.--\\": \\"y\\",\n  \\"--..\\": \\"z\\",\n  \\".-.-.-\\": \\".\\",\n  \\"--..--\\": \\",\\",\n  \\"..--..\\": \\"?\\",\n  \\"-.-.--\\": \\"!\\",\n  \\"-....-\\": \\"-\\",\n  \\"-..-.\\": \\"/\\",\n  \\".--.-.\\": \\"@\\",\n  \\"-.--.\\": \\"(\\",\n  \\"-.--.-\\": \\")\\",\n  \\" \\": \\"\\",\n  \\"/\\": \\" \\"\n}"
	getDictionary(Text2)
	@dictt
	const ProvidedInput1 = prompt("Enter your morse code?")
	const Text3 = getText(ProvidedInput1)
	splitText(Text3, " ")
	@Inn
	for _ in @Inn {
		if @RepeatItem ==  {
		}
	}
	const CombinedText = joinText(RepeatResults1, "Custom")
	uppercase(CombinedText)
	@Final
	@Resultt = @Final
	menu "Your Text: {@Resultt}" {
	item "Copy":
		setClipboard(@Resultt)
	item "Exit":
		stop()
	}
}
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

More by arirafiq

See All

You Might Also Like

See All
Advertisement