ShareShortcuts

Humin Menu

How does it work?

humin
Fork “Humin Menu”

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 humin 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
37K
Saved
0
Actions
221
Category
Utilities
Version
1.5
Language
EN

How does it work?

By running this shortcut, you can access the project settings. This will allow you to generate a user ID, set your home location or see how much contribution has been made to the project.

ID generation is based on https://routinehub.co/shortcut/1163.# Integration within the Humin ecosystem

This shortcut is meant to be used within the Humin ecosystem, as part of our Data Research & Development project. The other shortcuts for this project can be found here:

To know more about the project or get involved, don’t hesitate to reach out to us!

About Humin

We are building a Fitbit for mental health: bringing objective, passive, personalised symptom tracking for mood.

Our mission is to bring deep and personalised insights to support people to understand their mood symptoms. We are doing this using AI and anonymised data. Our vision is to bring quality mental health insights to everyone, to help them get the right care at the right time.

News

We are currently developing our MVP. If you wish to reach out to us and/or help us in our research, please reach out to us by visiting our website at https://humin.uk/.

Go and check out our podcast on mental health:

What's New

Version 1.5

Changed a few prompts

Version History
1.5 Nov 21, 2022

Changed a few prompts

1.4 Nov 21, 2022

Simplified menu options

1.3 Nov 21, 2022

Updated some prompts

1.2 Nov 21, 2022

Fixing bug around setting a new home location

1.1 Nov 20, 2022

Added support for automated updates

1.0 Nov 20, 2022

First release

What it does

221 actions
  1. Dictionary
  2. Text
  3. Set Variable
    last_date_filename
  4. Text
  5. Set Variable
    first_date_filename
  6. Get File
  7. If
  8. Adjust Date
  9. Text
  10. Save File
  11. Save File
  12. Text
  13. Set Variable
    user_id_filename
  14. Dictionary
  15. Set Variable
    input_options_dict
  16. If
  17. Choose from Menu
    Welcome to Humin's main menu. This shortcut allows you to see and modify all your settings. What setting do you want to see?
  18. Choose from Menu
    My ID
  19. Run Shortcut
    Show in Maps 1
  20. Stop This Shortcut
  21. Choose from Menu
    My home location
  22. Run Shortcut
    Show in Maps 1
  23. Stop This Shortcut
  24. Choose from Menu
    My data
  25. Run Shortcut
    Humin Menu
  26. Stop This Shortcut
  27. Get Dictionary from Input
  28. Set Variable
    input_dict
  29. Get Dictionary Value
  30. Set Variable
    mode
  31. If
  32. Get File
  33. Get Text from Input
  34. Get Dates from Input
  35. Set Variable
    last_date_saved
  36. Get File
  37. Get Text from Input
  38. Get Dates from Input
  39. Set Variable
    first_date_saved
  40. Get Time Between Dates
  41. Set Variable
    days_already_processed
  42. Get Time Between Dates
  43. Calculate
  44. Set Variable
    days_left_to_process
  45. If
  46. Number
  47. Set Variable
    days_left_to_process
  48. Text
  49. Choose from Menu
    …
  50. Choose from Menu
    ⬅️ Back
  51. Run Shortcut
    Humin Menu
  52. Stop This Shortcut
  53. If
  54. Get File
  55. If
  56. Dictionary
  57. Save File
  58. Set Variable
    old_homes_list
  59. If
  60. Dictionary
  61. Set Variable
    old_homes_address_to_index
  62. Get Dictionary from Input
  63. Set Variable
    old_homes_list
  64. Repeat with Each
  65. Set Dictionary Value
  66. Set Variable
    old_homes_address_to_index
  67. Text
  68. Get File
  69. Get Dictionary from Input
  70. Set Variable
    home_dict
  71. If
  72. If
  73. Choose from Menu
    Your current home location is ….
  74. Choose from Menu
    Change home to a previous location
  75. If
  76. Text
  77. Show Alert
    Warning
  78. Run Shortcut
    Show in Maps
  79. Stop This Shortcut
  80. If
  81. List
  82. Choose from List
  83. If
  84. Run Shortcut
    Show in Maps 1
  85. Stop This Shortcut
  86. Get Dictionary Value
  87. Set Variable
    to_pass
  88. Dictionary
  89. Run Shortcut
    Show in Maps
  90. Stop This Shortcut
  91. Choose from Menu
    Define a new home location
  92. Run Shortcut
    Show in Maps
  93. Stop This Shortcut
  94. Choose from Menu
    Delete previous location(s) from records
  95. If
  96. Text
  97. Show Alert
    Warning
  98. Run Shortcut
    Show in Maps
  99. Stop This Shortcut
  100. If
  101. Choose from List
  102. Repeat with Each
  103. If
  104. List
  105. Set Variable
    old_homes_list_new
  106. Dictionary
  107. Set Variable
    final_dict_old_homes
  108. If
  109. Set Dictionary Value
  110. Set Variable
    final_dict_old_homes
  111. Save File
  112. Text
  113. Show Result
  114. Run Shortcut
    Show in Maps
  115. Stop This Shortcut
  116. Choose from Menu
    ⬅️ Back
  117. Run Shortcut
    Show in Maps 1
  118. Stop This Shortcut
  119. If
  120. Text
  121. Show Alert
    Information
  122. Get Dictionary Value
  123. If
  124. Set Variable
    home_data
  125. Repeat with Each
  126. If
  127. List
  128. Set Variable
    old_homes_list_new
  129. Set Variable
    old_homes_list
  130. If
  131. Location
  132. Show in Maps
  133. Choose from Menu
    Is it the right address?
  134. Choose from Menu
    Yes
  135. Text
  136. Set Variable
    home_data
  137. Choose from Menu
    No, let’s try again
  138. Run Shortcut
    Show in Maps
  139. Stop This Shortcut
  140. If
  141. Get Dictionary Value
  142. Set Variable
    prev_home_data
  143. Count
  144. If
  145. Set Variable
    old_homes_list
  146. If
  147. If
  148. List
  149. Set Variable
    old_homes_list
  150. Dictionary
  151. Set Variable
    final_old_homes_dict
  152. If
  153. Set Dictionary Value
  154. Set Variable
    final_old_homes_dict
  155. Save File
  156. Get Dictionary from Input
  157. Save File
  158. Text
  159. Show Alert
    Information
  160. Run Shortcut
    Show in Maps 1
  161. Stop This Shortcut
  162. If
  163. Get File
  164. Get Dictionary from Input
  165. Set Variable
    user_id_dict
  166. If
  167. If
  168. Text
  169. Show Result
  170. Run Shortcut
    Show in Maps 1
  171. Stop This Shortcut
  172. If
  173. Choose from Menu
    You current user ID is ….
  174. Choose from Menu
    ⬅️ Back
  175. Run Shortcut
    Show in Maps 1
  176. Stop This Shortcut
  177. Dictionary
  178. Set Variable
    IntToHex
  179. List
  180. Set Variable
    Output
  181. List
  182. Set Variable
    N
  183. Repeat
  184. Random Number
  185. Add to Variable
  186. Number
  187. Set Variable
    Last
  188. Repeat with Each
  189. Calculate
  190. Calculate
  191. Set Variable
    Last
  192. Get Dictionary Value
  193. Set Variable
    N
  194. Repeat
  195. Random Number
  196. Get Dictionary Value
  197. Set Variable
    Random
  198. Get Item from List
  199. Combine Text
  200. Add to Variable

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'
#include 'actions/documents'
#include 'actions/calendar'
#define color violet
#define glyph sliders

@last_date_filename = "Humin/lastDateSaved.txt"
@first_date_filename = "Humin/firstDateSaved.txt"
const File = getFileFromFolder(, @first_date_filename, false)

if !File {
	adjustDate(CurrentDate, "Subtract")
	const Text = "{}"
	saveFile("Humin/lastDateSaved.txt", Text, true)
	saveFile("Humin/firstDateSaved.txt", Text, true)
}
@user_id_filename = "Humin/user_id.json"
@input_options_dict = {
	"input data": {
		"mode": "3"
	},
	"input home": {
		"mode": "2"
	},
	"input home new location": {
		"data": "Set location",
		"mode": "2"
	},
	"input id": {
		"mode": "1"
	},
	"input id new id": {
		"data": "Set ID",
		"mode": "1"
	}
}

if !ShortcutInput {
	menu "Welcome to Humin's main menu. This shortcut allows you to see and modify all your settings. What setting do you want to see?" {
	item "My ID":
		runSelf(@input_options_dict)
		stop()
	item "My home location":
		runSelf(@input_options_dict)
		stop()
	item "My data":
		runSelf(@input_options_dict)
		stop()
	}
}
getDictionary(ShortcutInput)
@input_dict
@mode = @input_dict['mode']

if @mode == "3" {
	const File1 = getFile(@last_date_filename)
	const Text1 = getText(File1)
	getDates(Text1)
	@last_date_saved
	const File2 = getFile(@first_date_filename)
	const Text2 = getText(File2)
	getDates(Text2)
	@first_date_saved
	rawAction("is.workflow.actions.gettimebetweendates", {
		"WFInput": "{@last_date_saved}",
		"WFTimeUntilFromDate": "{@first_date_saved}",
		"WFTimeUntilUnit": "Days"
	})
	@days_already_processed
	rawAction("is.workflow.actions.gettimebetweendates", {
		"WFInput": "{CurrentDate}",
		"WFTimeUntilFromDate": "{@last_date_saved}",
		"WFTimeUntilUnit": "Days"
	})
	@days_left_to_process = TimeBetweenDates - 2
	if @days_left_to_process < 0 {
		@days_left_to_process = 0
	}
	menu  {
	item "⬅️ Back":
		runSelf()
		stop()
	}
}

if @mode == "2" {
	const old_homes_file = getFile("Humin/old_homes.json", false)
	if !old_homes_file {
		const Dictionary = {
			"old_homes": null
		}
		saveFile("Humin/old_homes.json", Dictionary, true)
		@old_homes_list = Dictionary['old_homes']
	} else {
		@old_homes_address_to_index = {}
		getDictionary(old_homes_file)
		@old_homes_list = ['old_homes']
		for _ in @old_homes_list {
			setValue(@old_homes_address_to_index, @RepeatItem['address'], @RepeatItem)
			@old_homes_address_to_index
		}
	}
	const filename = "Humin/home.json"
	const home_file = getFile(filename, false)
	getDictionary(home_file)
	@home_dict
	if @input_dict !contains "data" {
		if @home_dict {
			menu "Your current home location is {@home_dict['address']}." {
			item "Change home to a previous location":
				if !@old_homes_list {
					alert(, "Warning")
					runSelf(@input_options_dict)
					stop()
				} else {
					const List = list(@old_homes_address_to_index['Keys'], "⬅️ Back")
					const ChosenItem = chooseFromList(List, "Here are your previous locations. Which one do you want to set?")
					if ChosenItem == "⬅️ Back" {
						runSelf(@input_options_dict)
						stop()
					}
					@to_pass = @old_homes_address_to_index[ChosenItem]
					const Dictionary1 = {
						"data": "{@to_pass}",
						"mode": "{@mode}"
					}
					runSelf(Dictionary1)
					stop()
				}
			item "Define a new home location":
				runSelf(@input_options_dict)
				stop()
			item "Delete previous location(s) from records":
				if !@old_homes_list {
					alert(, "Warning")
					runSelf(@input_options_dict)
					stop()
				} else {
					const ChosenItem1 = chooseFromList(@old_homes_address_to_index, "Which locations would you like to delete?", true)
					for _ in @old_homes_list {
						if ChosenItem1 !contains @RepeatItem['address'] {
							list(@old_homes_list_new, @RepeatItem)
							@old_homes_list_new
						}
					}
					@final_dict_old_homes = {
						"old_homes": null
					}
					if @old_homes_list_new {
						setValue(@final_dict_old_homes, "old_homes", @old_homes_list_new)
						@final_dict_old_homes
					}
					saveFile("Humin/old_homes.json", @final_dict_old_homes, true)
					show()
					runSelf(@input_options_dict)
					stop()
				}
			item "⬅️ Back":
				runSelf()
				stop()
			}
		} else {
			alert(, "Information")
		}
	}
	const input_data = getValue(@input_dict, "data")
	if input_data contains "latitude" {
		@home_data = input_data
		for _ in @old_homes_list {
			if @RepeatItem !contains @home_data['address'] {
				list(@old_homes_list_new, @RepeatItem)
				@old_homes_list_new
			}
		}
		@old_homes_list = @old_homes_list_new
	} else {
		const Location = location(Ask: "What is your home location?")
		openInMaps(Location)
		menu "Is it the right address?" {
		item "Yes":
			@home_data = "{\\"latitude\\": \\"{Location['Latitude']}\\", \\"longitude\\": \\"{Location['Longitude']}\\", \\"address\\": \\"{Location['Street']}, {Location['City']}, {Location['ZIP Code']}, {Location['Country']}\\"}"
		item "No, let’s try again":
			runSelf(@input_options_dict)
			stop()
		}
	}
	if @home_dict {
		@prev_home_data = @home_dict['address']
		const Count = count(@old_homes_list)
		if Count == 0 {
			@old_homes_list = @prev_home_data
		} else {
			if @old_homes_list !contains @prev_home_data['address'] {
				list(@old_homes_list, @prev_home_data)
				@old_homes_list
			}
		}
		@final_old_homes_dict = {
			"old_homes": null
		}
		if @old_homes_list {
			setValue(@final_old_homes_dict, "old_homes", @old_homes_list)
			@final_old_homes_dict
		}
		saveFile("Humin/old_homes.json", @final_old_homes_dict, true)
	}
	const Dictionary2 = getDictionary(@home_data)
	saveFile(filename, Dictionary2, true)
	alert(, "Information")
	runSelf()
	stop()
}

if @mode == "1" {
	const File3 = getFile(@user_id_filename, false)
	getDictionary(File3)
	@user_id_dict
	if @input_dict !contains "data" {
		if !@user_id_dict {
			show()
			runSelf(@input_options_dict)
			stop()
		} else {
			menu "You current user ID is {@user_id_dict['userID']}." {
			item "⬅️ Back":
				runSelf()
				stop()
			}
		}
	}
	@IntToHex = {
		"1": "1",
		"10": "a",
		"11": "b",
		"12": "c",
		"13": "d",
		"14": "e",
		"15": "f",
		"2": "2",
		"3": "3",
		"4": "4",
		"5": "5",
		"6": "6",
		"7": "7",
		"8": "8",
		"9": "9"
	}
	list()
	@Output = nil
	list("1", "0")
	@N
	repeat _ for 2 {
		randomNumber(0, 1)
		@N
	}
	@Last = 0
	for _ in @N {
		const CalculationResult = @Last * 2
		@Last = CalculationResult + @RepeatItem
	}
	@N = @IntToHex[@Last]
	repeat _ for 30 {
		randomNumber(1, 15)
		getValue(@IntToHex)
	}
	@Random
	const ItemFromList = getListItems(@Random, 0, 8)
	joinText(ItemFromList, "Custom")
	@Output
	const ItemFromList1 = getListItems(@Random, 9, 12)
	joinText(ItemFromList1, "Custom")
	@Output
	const ItemFromList2 = getListItems(@Random, 13, 15)
	joinText(ItemFromList2, "Custom")
	@Output += "4{}"
	const ItemFromList3 = getListItems(@Random, 16, 18)
	joinText(ItemFromList3, "Custom")
	@Output += "{@N}{}"
	const ItemFromList4 = getListItems(@Random, 19, 30)
	joinText(ItemFromList4, "Custom")
	@Output
	joinText(@Output, "-")
	const Dictionary3 = {
		"userID": "{}"
	}
	saveFile(@user_id_filename, Dictionary3, true)
	show()
	runSelf()
	stop()
}
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 humin

See All

You Might Also Like

See All
Advertisement