ShareShortcuts

Base64 Encode/Decode Machine

coltensus
Fork “Base64 Encode/Decode Machine”

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 coltensus 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
40K
Saved
0
Actions
62
Category
API
Version
1.0
Language
EN

Yahjz

What's New

Version 1.0

First release

Version History
1.0 Jul 25, 2022

First release

What it does

62 actions
  1. Text
  2. List
  3. Choose from List
  4. Set Variable
    encodeOrDecode
  5. If
  6. Text
  7. List
  8. Choose from List
  9. Set Variable
    whatEncode
  10. If
  11. Select File
  12. Base64 Encode
  13. Set Variable
    base64Encoded
  14. If
  15. Record Audio
  16. Base64 Encode
  17. Set Variable
    base64Encoded
  18. If
  19. Ask for Input
    Enter text
  20. Base64 Encode
  21. Set Variable
    base64Encoded
  22. Text
  23. List
  24. Choose from List
  25. Set Variable
    howSave
  26. If
  27. Save File
  28. Show Notification
    Your base64 file has been saved!
  29. If
  30. Copy to Clipboard
  31. Show Notification
    Copied to clipboard!
  32. If
  33. Copy to Clipboard
  34. Save File
  35. Show Notification
    File has been saved and have been copied to your clipboard!
  36. If
  37. Text
  38. List
  39. Choose from List
  40. Set Variable
    whatDecode
  41. If
  42. Select File
  43. Set Variable
    file
  44. Base64 Encode
  45. Set Variable
    base64Decoded
  46. If
  47. Get Clipboard
  48. Base64 Encode
  49. Set Variable
    base64Decoded
  50. If
  51. Select File
  52. Set Variable
    audio
  53. Base64 Encode
  54. Set Variable
    base64Decoded
  55. Text
  56. List
  57. Choose from List
  58. If
  59. Get Variable
  60. Play Sound
  61. Save File
  62. Show Notification
    Decided file has been saved!

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/sharing'
#include 'actions/media'
#include 'actions/documents'
#define color teal
#define glyph networkStorage

const Text0 = "Welcome to the Base64 Encode/Decode Machine! \n--------------------------------\nWhat would you like to do?\n----------------\nCreated by u/VanishingTacos"
const List = list("Encode", "Decode")
chooseFromList(List, Text0, false, false)
@encodeOrDecode

if @encodeOrDecode contains "Encode" {
	const Text1 = "What would you like to encode?"
	const List1 = list("File", "Recorded Audio", "Input Text")
	chooseFromList(List1, Text1)
	@whatEncode
	if @whatEncode contains "File" {
		const File = selectFile()
		base64Encode(File)
		@base64Encoded
	}
	if @whatEncode contains "Recorded Audio" {
		const RecordedAudio = recordAudio()
		base64Encode(RecordedAudio)
		@base64Encoded
	}
	if @whatEncode contains "Input Text" {
		const ProvidedInput = prompt("Enter text")
		base64Encode(ProvidedInput)
		@base64Encoded
	}
	const Text5 = "How would you like to save?"
	const List2 = list("Save File", "Copy to Clipbored ", "Both")
	chooseFromList(List2, Text5)
	@howSave
	if @howSave contains "Save File" {
		const SavedFile = saveFilePrompt(@base64Encoded)
		showNotification("Your base64 file has been saved!", "Base64 Encode/Decode Machine", SavedFile)
	}
	if @howSave contains "Copy to Clipbored " {
		setClipboard(@base64Encoded)
		showNotification("Copied to clipboard!", "Base64 Encode/Decode Machine")
		if @howSave contains "Both" {
			setClipboard(@base64Encoded)
			const SavedFile1 = saveFilePrompt(@base64Encoded)
			showNotification("File has been saved and have been copied to your clipboard!", "Base64 Encode/Decode Machine", SavedFile1)
		}
	}
} else {
	const Text3 = "What would you like to decode?"
	const List3 = list("File", "From Clipbored ", "Audio")
	chooseFromList(List3, Text3)
	@whatDecode
	if @whatDecode contains "File" {
		selectFile()
		@file
		base64Encode(@file)
		@base64Decoded
	}
	if @whatEncode contains "From Clipbored " {
		const Clipboard = getClipboard()
		base64Encode(Clipboard)
		@base64Decoded
	}
	if @whatDecode contains "Audio" {
		selectFile()
		@audio
		base64Encode(@audio)
		@base64Decoded
		const List4 = list("Yes ", "No")
		const ChosenItem = chooseFromList(List4)
		if ChosenItem contains "Yes" {
			// TODO: Get Variable not supported: Assign variable here to '@base64Decoded'.
			playSound(@base64Decoded)
		}
	}
	const SavedFile2 = saveFilePrompt(@base64Decoded)
	showNotification("Decided file has been saved!", "Base64 Encode/Decode Machine", SavedFile2)
}
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 coltensus

See All

You Might Also Like

See All
Advertisement