ShareShortcuts

Totally Not A Shortcut Updater

Completely redesigned from the ground up!

theshortcutguy2
Fork “Totally Not A Shortcut Updater”

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 theshortcutguy2 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
39K
Saved
0
Actions
66
Category
Utilities
Version
1.2
Language
EN

Completely redesigned from the ground up!

Totally Not A Shortcut Updater is an updater whose focus is being as smooth as possible.

What's New

Version 1.2

New Menu for Settings! And, obviously, bug fixes.

Version History
1.2 Aug 29, 2024

New Menu for Settings! And, obviously, bug fixes.

1.1 Sep 18, 2022

Nothing

1.0 Sep 18, 2022

First release

What it does

66 actions
  1. Comment
    Settings for the Updater:
  2. Dictionary
  3. Comment
    Files saved to On My iPhone
  4. Set Variable
    WhereSave
  5. If
  6. File
  7. Set Variable
    SavingTo
  8. If
  9. File
  10. Set Variable
    SavingTo
  11. Create Folder
  12. Comment
    Clear Skips and Rollbacks after 7 days
  13. Set Variable
    WhenClear
  14. Get File
  15. If
  16. Get Details of Files
  17. Get Time Between Dates
  18. If
  19. Delete Files
  20. Get File
  21. If
  22. Get Details of Files
  23. Get Time Between Dates
  24. If
  25. Delete Files
  26. Comment
    Latest Version Message
  27. Set Variable
    VersionMessage
  28. Comment
    Input Shortcut Variables
  29. Get Dictionary from Input
  30. Set Variable
    OGSH-Name
  31. Set Variable
    OGSH-Version
  32. Set Variable
    OGSH-RHID
  33. Comment
    Online Shortcut Data Variables
  34. Get Contents of URL
    https://routinehub.co/api/v1/shortcuts/…/versions/latest
  35. Get Dictionary from Input
  36. Set Variable
    ONL-Version
  37. Set Variable
    ONL-iURL
  38. Comment
    No need to update
  39. If
  40. If
  41. Show Alert
  42. If
  43. Comment
    Need to update
  44. If
  45. Get File
  46. If
  47. Choose from Menu
    An update is available! (Version … ▶️ Version …)
  48. Choose from Menu
    Skip
  49. Text
  50. Save File
  51. Text
  52. Save File
  53. Choose from Menu
    Update
  54. Open URLs
  55. Comment
    Need to rollback
  56. If
  57. Get File
  58. If
  59. Choose from Menu
    A rollback is available! (Version … ▶️ Version …)
  60. Choose from Menu
    Skip
  61. Text
  62. Save File
  63. Text
  64. Save File
  65. Choose from Menu
    Update
  66. Open URLs

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 blue
#define glyph syncArrows

// Settings for the Updater:

// Files saved to On My iPhone

@WhereSave = {
	"Clear Skips and Rollbacks after 7 days": false,
	"Files saved to On My iPhone": true,
	"Latest Version Message": false
}

if @WhereSave ==  {
	file()
	@SavingTo
} else {
	file()
	@SavingTo
}
createFolder("TNASU")
// Clear Skips and Rollbacks after 7 days

@WhenClear = ['Clear Skips and Rollbacks after 7 days']
const File = getFile("rollback-skip.txt", @SavingTo, false)

if File {
	const CreationDate = getFileDetail(nil, "Creation Date")
	rawAction("is.workflow.actions.gettimebetweendates", {
		"WFInput": "{CreationDate}",
		"WFTimeUntilFromDate": "{CurrentDate}"
	})
	if TimeBetweenDates == 7 {
		deleteFiles(File)
	}
}
const File1 = getFile("update-skip.txt", @SavingTo, false)

if File1 {
	getFileDetail(nil, CreationDate)
	rawAction("is.workflow.actions.gettimebetweendates", {
		"WFInput": "{}",
		"WFTimeUntilFromDate": "{CurrentDate}",
		"WFTimeUntilUnit": "Days"
	})
	if TimeBetweenDates1 == 7 {
		deleteFiles(File1)
	}
}
// Latest Version Message

@VersionMessage = ['Latest Version Message']
// Input Shortcut Variables

getDictionary(ShortcutInput)
@OGSHName = ['Name']
@OGSHVersion = ['Version']
@OGSHRHID = ['ID']
// Online Shortcut Data Variables

const ContentsOfURL = downloadURL("https://routinehub.co/api/v1/shortcuts/{@OGSHRHID}/versions/latest")
getDictionary(ContentsOfURL)
@ONLVersion = ['Version']
@ONLiURL = ['URL']
// No need to update


if @OGSHVersion == @ONLVersion {
	if @VersionMessage ==  {
		confirm("{@OGSHName} is at the latest version. (Version {@OGSHVersion})\n")
	} else {
	}
}
// Need to update 


if @OGSHVersion < @ONLVersion {
	const File2 = getFile("/UD-S-{@OGSHName}.txt", @SavingTo, false)
	if !File2 {
		menu "An update is available!                      (Version  {@OGSHVersion} ▶️ Version {@ONLVersion})" {
		item "Skip":
			const Text = "{@OGSHName}\nUpdate\nSkip: Yes"
			saveFile("/UD-S-{@OGSHName}.txt", Text, true)
			const Text1 = "{CurrentDate}"
			saveFile("/rollback-skip.txt", Text1, true)
		item "Update":
			openURL(@ONLiURL)
		}
	}
}
// Need to rollback


if @OGSHVersion > @ONLVersion {
	const File3 = getFile("/RB-S-{@OGSHName}.txt", @SavingTo, false)
	if !File3 {
		menu "A rollback is available!                      (Version  {@OGSHVersion} ▶️ Version {@ONLVersion})" {
		item "Skip":
			const Text2 = "{@OGSHName}\nRollback\nSkip: Yes"
			saveFile("/RB-S-{@OGSHName}.txt", Text2, true)
			const Text3 = "{CurrentDate}"
			saveFile("update-skip.txt", Text3, true)
		item "Update":
			openURL(@ONLiURL)
		}
	}
}
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 theshortcutguy2

See All

You Might Also Like

See All
Advertisement