ShareShortcuts
Создать форк «Reminders to PDF»

Создали что-то новое на основе этой команды? Поделитесь ей как форком: она станет вашей собственной командой, которой вы управляете, а обе страницы будут ссылаться друг на друга, чтобы twilsonco получил(а) признание.

  1. 1Получите команду и измените её в приложении «Быстрые команды». Дайте ей собственное название.
  2. 2Поделись ею из приложения «Быстрые команды» и скопируй ссылку iCloud.
  3. 3Вернись сюда, вставь ссылку и опиши, что изменилось, например: «Добавлен шаг, который использует Apple Intelligence для персонализации текста».
Загрузки
26K
Сохранено
0
Действия
250
Категория
Productivity
Версия
1.0
Язык
EN

Просмотр

  • You specify one or more Reminders lists along with number of past/future days to include, and when run, the shortcut produces a nicely formatted PDF that contains all reminders in the specified lists, one PDF per list
  • Shows most pertinent reminder data if present: title, name (if different from title), notes, completed, priority, flagged, tags, location (macOS only due to a bug in iOS), URL, images, and subtasks
  • Works with repeat reminders, showing next due instance of the repeat reminder and the count of completed instances
  • Images are added by first uploading to Imgur (one image per image-containing reminder)
  • Here's what the resulting PDF looks like (see screenshot)

Что нового

Версия 1.0

First release

История версий
1.0 9 фев 2024 г.

First release

Что делает

Действий: 250
  1. Comment
    Create compiled PDF from specified Reminders lists, one PDF file per list
  2. Comment
    Check for shortcut updates
  3. Nothing
  4. Comment
    【Auto-Update Routine】 Checks For Latest Shortcut Version ↳ https://routinehub.co/shortcut/16590/
  5. Dictionary
  6. Get Dictionary Value
  7. If
  8. Get IP Address
  9. If
  10. Get Contents of URL
    https://routinehub.co/api/v1/shortcuts/…/versions/latest
  11. If
  12. Split Text
  13. Repeat with Each
  14. Calculate Expression
  15. Set Variable
    Latest Version
  16. Split Text
  17. Repeat with Each
  18. Calculate Expression
  19. Set Variable
    Current Version
  20. If
  21. Choose from Menu
    New Version: … Release: … Whats New: "…"
  22. Choose from Menu
    Update → Result (Version)
  23. Expand URL
  24. Replace Text
  25. Open URLs
  26. Stop This Shortcut
  27. Choose from Menu
    Skip (Info (Version))
  28. Comment
    【Auto-Update Routine Ends Here】 Support → https://www.reddit.com/r/shortcuts/comments/18j4f9p/ 【⚙️】 Convert Semantic Number to Decimals ↳ https://routinehub.co/shortcut/16589/
  29. Nothing
  30. Comment
    Specify one or more Reminders lists, one per line
  31. Text
  32. Comment
    When searching for reminders, how many days into the past should be searched?
  33. Number
  34. Comment
    When searching for reminders, how many days into the future should be searched?
  35. Number
  36. Comment
    Enter the text that goes in each PDF title between each lists’ reminder count and name. For example, to get the title “12 reminder(s) in list Work Reminders”, you would enter “reminder(s) in list” as the value. Please enter in whatever language you …
  37. Text
  38. Comment
    Size for downscaling images before they’re combined into a grid and uploaded to Imgur (combination is necessary to avoid hitting their 50 image per hour upload limit)
  39. Number
  40. Nothing
  41. Comment
    Function to construct markdown string from reminder
  42. Get Type
  43. If
  44. Set Variable
    InputReminder
  45. Get Details of Reminders
  46. Get Details of Reminders
  47. If
  48. Text
  49. If
  50. If
  51. Text
  52. If
  53. If
  54. Text
  55. If
  56. Nothing
  57. Get Details of Reminders
  58. If
  59. Text
  60. If
  61. Nothing
  62. Get Details of Reminders
  63. If
  64. Text
  65. If
  66. Nothing
  67. Get Details of Reminders
  68. If
  69. Text
  70. If
  71. Nothing
  72. Get Details of Reminders
  73. If
  74. Text
  75. If
  76. Nothing
  77. Get Details of Reminders
  78. If
  79. Repeat with Each
  80. Text
  81. Add to Variable
  82. Combine Text
  83. Text
  84. If
  85. Nothing
  86. Get Details of Reminders
  87. If
  88. Get Component of URL
  89. Text
  90. If
  91. Nothing
  92. Get Details of Reminders
  93. If
  94. Text
  95. If
  96. Nothing
  97. Get Details of Reminders
  98. If
  99. Get Device Details
  100. If
  101. Comment
    Accessing location causes KCLErrorDomain error 2 on iOS, so only include for Mac
  102. Split Text
  103. Combine Text
  104. Text
  105. If
  106. Text
  107. If
  108. Nothing
  109. Get Details of Reminders
  110. If
  111. Set Variable
    ImgList
  112. Repeat with Each
  113. Resize Image
  114. Add to Variable
  115. Count
  116. Calculate
  117. If
  118. Combine Images
  119. Set Variable
    Img
  120. If
  121. Combine Images
  122. Set Variable
    Img
  123. List
  124. Calculate Statistics
  125. If
  126. Resize Image
  127. Set Variable
    Img
  128. Imgur Upload
  129. Text
  130. If
  131. Nothing
  132. Text
  133. Stop and Output
  134. Choose from Menu
    Save PDF file to iCloud documents folder?
  135. Choose from Menu
    Yes
  136. Number
  137. Choose from Menu
    No (view/share only)
  138. Number
  139. Set Variable
    SavePDF
  140. Date
  141. Adjust Date
  142. Adjust Date
  143. Adjust Date
  144. Find Reminders
  145. Adjust Date
  146. Adjust Date
  147. Split Text
  148. Repeat with Each
  149. Find Reminders
  150. Nothing
  151. Set Variable
    ReminderCheckDict
  152. Repeat with Each
  153. If
  154. Text
  155. If
  156. Get Dictionary Value
  157. Get Dictionary Value
  158. If
  159. Calculate
  160. If
  161. Number
  162. Get Dictionary Value
  163. Calculate
  164. If
  165. Get Dictionary Value
  166. If
  167. Nothing
  168. If
  169. Nothing
  170. If
  171. Get Details of Reminders
  172. If
  173. If
  174. Dictionary
  175. If
  176. Dictionary
  177. Set Dictionary Value
  178. Set Variable
    ReminderCheckDict
  179. If
  180. If
  181. If
  182. Get Time Between Dates
  183. Calculate
  184. Get Time Between Dates
  185. Calculate
  186. If
  187. Text
  188. If
  189. Text
  190. Dictionary
  191. Set Dictionary Value
  192. Set Variable
    ReminderCheckDict
  193. If
  194. Dictionary
  195. Set Dictionary Value
  196. Set Variable
    ReminderCheckDict
  197. If
  198. If
  199. Number
  200. If

Посмотреть как код
Бета

Все действия этой команды, записанные на Cherri — языке программирования для приложения «Быстрые команды». Отлично подходит, чтобы разобраться, как она работает.

#include 'actions/web'
#include 'actions/network'
#define color blue
#define glyph checklist

// Create compiled PDF from specified Reminders lists, one PDF file per list

// Check for shortcut updates

nothing()
/*
【Auto-Update Routine】
Checks For Latest Shortcut Version
↳ https://routinehub.co/shortcut/16590/
*/
const Info = {
	"Author": "twilsonco",
	"RoutineHub ID": 17512,
	"Version": "1.0.2",
	"Version Check": true
}
const True = getValue(Info, "Version Check")

if True == "Yes" {
	const CurrentIPAddress = getExternalIP("IPv4")
	if CurrentIPAddress {
		const Result = downloadURL("https://routinehub.co/api/v1/shortcuts/{Info['RoutineHub ID']}/versions/latest")
		if Result contains "success" {
			const SplitText = splitText(Result['Version'], ".")
			for _ in SplitText {
				@LatestVersion = ((1/1000)^@RepeatIndex)*@RepeatItem+@LatestVersion
			}
			const SplitText1 = splitText(Info['Version'], ".")
			for _ in SplitText1 {
				@CurrentVersion = ((1/1000)^@RepeatIndex)*@RepeatItem+@CurrentVersion
			}
			if @LatestVersion > @CurrentVersion {
				menu "New Version: {Result['Version']}\nRelease: {Result['Release']}\nWhats New: \"{Result['Notes']}\"" {
				item "Update → {Result['Version']}":
					expandURL(Result['URL'])
					const UpdatedText = replaceText("https://www.icloud.com/", "shortcuts://", false)
					openURL(UpdatedText)
					stop()
				item "Skip ({Info['Version']})":
				}
			}
		}
	}
}
/*
【Auto-Update Routine Ends Here】
Support → https://www.reddit.com/r/shortcuts/comments/18j4f9p/

【⚙️】
Convert Semantic Number to Decimals
↳ https://routinehub.co/shortcut/16589/
*/
nothing()
// Specify one or more Reminders lists, one per line

const ReminderList = "Reminders\nWork\nHome"
// When searching for reminders, how many days into the past should be searched?

const NumPastDays = 30
// When searching for reminders, how many days into the future should be searched?

const NumFutureDays = 30
// Enter the text that goes in each PDF title between each lists’ reminder count and name. For example, to get the title “12 reminder(s) in list Work Reminders”, you would enter “reminder(s) in list” as the value. Please enter in whatever language you want to use.

const TitleMiddleStr = "reminder(s) in list"
// Size for downscaling images before they’re combined into a grid and uploaded to Imgur (combination is necessary to avoid hitting their 50 image per hour upload limit)

const ImageSize = 150
nothing()
// Function to construct markdown string from reminder

const Type = typeOf(ShortcutInput)

if Type == "Reminder" {
	@InputReminder = ShortcutInput
	rawAction("is.workflow.actions.properties.reminders", {
		"WFContentItemPropertyName": "Title",
		"WFInput": "@InputReminder"
	})
	rawAction("is.workflow.actions.properties.reminders", {
		"WFContentItemPropertyName": "Priority",
		"WFInput": "@InputReminder"
	})
	if Priority ==  {
	} else {
		if Priority ==  {
		} else {
			if Priority ==  {
			} else {
			}
		}
	}
	rawAction("is.workflow.actions.properties.reminders", {
		"WFContentItemPropertyName": "Is Flagged",
		"WFInput": "@InputReminder"
	})
	if IsFlagged ==  {
	} else {
	}
	rawAction("is.workflow.actions.properties.reminders", {
		"WFContentItemPropertyName": "Notes",
		"WFInput": "@InputReminder"
	})
	if Notes {
	} else {
	}
	rawAction("is.workflow.actions.properties.reminders", {
		"WFContentItemPropertyName": "Due Date",
		"WFInput": "@InputReminder"
	})
	if DueDate {
	} else {
	}
	rawAction("is.workflow.actions.properties.reminders", {
		"WFContentItemPropertyName": "Completion Date",
		"WFInput": "@InputReminder"
	})
	if CompletionDate {
	} else {
	}
	rawAction("is.workflow.actions.properties.reminders", {
		"WFContentItemPropertyName": "Tags",
		"WFInput": "@InputReminder"
	})
	if Tags {
		for _ in Tags {
			@TagList += "`#{@RepeatItem}`"
		}
		joinText(@TagList, " ")
	} else {
	}
	rawAction("is.workflow.actions.properties.reminders", {
		"WFContentItemPropertyName": "URL",
		"WFInput": "@InputReminder"
	})
	if URL {
		getURLDetail(URL, "Host")
	} else {
	}
	rawAction("is.workflow.actions.properties.reminders", {
		"WFContentItemPropertyName": "Name",
		"WFInput": "@InputReminder"
	})
	if Name !=  {
	} else {
	}
	rawAction("is.workflow.actions.properties.reminders", {
		"WFContentItemPropertyName": "Reminder Location",
		"WFInput": "@InputReminder"
	})
	if ReminderLocation {
		const DeviceModel = getDeviceDetail("Device Model")
		if DeviceModel == "Mac" {
			// Accessing location causes KCLErrorDomain error 2 on iOS, so only include for Mac

			const SplitText2 = splitText(ReminderLocation)
			const InlineAddress = joinText(SplitText2, " ")
		} else {
		}
	} else {
	}
	rawAction("is.workflow.actions.properties.reminders", {
		"WFContentItemPropertyName": "Images",
		"WFInput": "@InputReminder"
	})
	if Images {
		@ImgList
		for _ in Images {
			resizeImage(@RepeatItem, ImageSize)
			@ImgList
		}
		const Count = count(@ImgList)
		const CalculationResult = Count * ImageSize
		if CalculationResult < 1000 {
			rawAction("is.workflow.actions.image.combine", {
				"WFImageCombineMode": "Horizontally",
				"WFImageCombineSpacing": "10",
				"WFInput": "@ImgList"
			})
			@Img
		} else {
			rawAction("is.workflow.actions.image.combine", {
				"WFImageCombineMode": "In a Grid",
				"WFImageCombineSpacing": "10",
				"WFInput": "@ImgList"
			})
			@Img = CombinedImage
			const ImgDims = list(CombinedImage['Width'], CombinedImage['Height'])
			const Maximum = statistic("Maximum", nil)
			if Maximum > 600 {
				resizeImageByLongestEdge(CombinedImage, "600")
				@Img
			}
		}
		rawAction("is.workflow.actions.imgur.upload", {
			"WFImgurAnonymous": false,
			"WFImgurDirectLink": true,
			"WFInput": "@Img"
		})
	} else {
	}
	const ReminderMarkdownOutputString = "{Priority1}{}{Name1}{Flagged}\n\n{Notes1}{DueDate1}{CompletionDate1}{Tags1}{Location}{URL1}{Images1}"
	output(ReminderMarkdownOutputString)
}

menu "Save PDF file to iCloud documents folder?" {
item "Yes":
item "No (view/share only)":
}
@SavePDF = 0
const CurrentDate = currentDate()
const PastDate = adjustDate(CurrentDate, "Subtract")
adjustDate(CurrentDate, "")
const FutureDate = adjustDate(, "Get Start of Day")
rawAction("is.workflow.actions.filter.reminders", {
	"WFContentItemFilter": ""
})
adjustDate(CurrentDate, "")
adjustDate(, "Get Start of Day")
const ReminderLists = splitText(ReminderList)

for _ in ReminderLists {
	rawAction("is.workflow.actions.filter.reminders", {
		"WFContentItemFilter": "",
		"WFContentItemInputParameter": "Reminders"
	})
	nothing()
	@ReminderCheckDict
	for _ in Reminders1 {
		if !@RepeatItem2 {
			const ReminderKey = "{@RepeatItem2}{@RepeatItem2['Notes']}{@RepeatItem2['Priority']}{@RepeatItem2['Is Flagged']}{@RepeatItem2['Tags']}"
			if @ReminderCheckDict contains ReminderKey {
				const RemCheckData = getValue(@ReminderCheckDict, ReminderKey)
				const OldNumCompleted = getValue(RemCheckData, "completed")
				if @RepeatItem2 ==  {
				} else {
					number(OldNumCompleted)
				}
				const NewTotal = getValue(RemCheckData, "total")
				const NewNumTotal = NewTotal + 1
				if RemCheckData['Keys'] contains "due date" {
					getValue(RemCheckData, "due date")
				} else {
				}
				if @RepeatItem2 ==  {
				} else {
					rawAction("is.workflow.actions.properties.reminders", {
						"WFContentItemPropertyName": "Due Date",
						"WFInput": "@RepeatItem2"
					})
				}
				if !RemDueDate {
					if CheckDueDate {
					} else {
					}
					setValue(@ReminderCheckDict, ReminderKey)
					@ReminderCheckDict
				} else {
					if RemCheckData['Keys'] contains "due date" {
						if @RepeatItem2 {
							rawAction("is.workflow.actions.gettimebetweendates", {
								"WFInput": "{RemCheckData['due date']}",
								"WFTimeUntilFromDate": "{}",
								"WFTimeUntilUnit": "Hours"
							})
							const TimeDistOld = TimeBetweenDates … nil
							rawAction("is.workflow.actions.gettimebetweendates", {
								"WFInput": "{}",
								"WFTimeUntilFromDate": "{}",
								"WFTimeUntilUnit": "Hours"
							})
							const TimeDistCur = TimeBetweenDates1 … nil
							if TimeDistCur < TimeDistOld {
							} else {
							}
							setValue(@ReminderCheckDict, ReminderKey)
							@ReminderCheckDict
						}
					} else {
						setValue(@ReminderCheckDict, ReminderKey)
						@ReminderCheckDict
					}
				}
			} else {
				if @RepeatItem2 ==  {
				} else {
				}
				rawAction("is.workflow.actions.properties.reminders", {
					"WFContentItemPropertyName": "Due Date",
					"WFInput": "@RepeatItem2"
				})
				if DueDate2 {
				} else {
				}
				setValue(@ReminderCheckDict, ReminderKey)
				@ReminderCheckDict
			}
		}
	}
	count(@ReminderCheckDict)
	@ReminderCount
	@PDFText = "nil"
	for _ in @ReminderCheckDict {
		const CurRemDict = getValue(@ReminderCheckDict, @RepeatItem2)
		if CurRemDict['Keys'] contains "due date" {
			rawAction("is.workflow.actions.filter.reminders", {
				"WFContentItemFilter": "",
				"WFContentItemLimitEnabled": true,
				"WFContentItemLimitNumber": 1
			})
		} else {
			rawAction("is.workflow.actions.filter.reminders", {
				"WFContentItemFilter": "",
				"WFContentItemLimitEnabled": true,
				"WFContentItemLimitNumber": 1
			})
		}
		@CurRem
		const CurRemNumTotal = getValue(CurRemDict, "total")
		const CurRemNumComplete = getValue(CurRemDict, "completed")
		if CurRemNumComplete == CurRemNumTotal {
		} else {
		}
		if CurRemNumTotal > 1 {
			if CurRemNumComplete < CurRemNumTotal {
			} else {
			}
		} else {
		}
		const ReminderMarkdownString = runSelf(@CurRem)
		@PDFText = "\n{@PDFText}\n\n-----\n\n## {CompleteStr}{ReminderMarkdownString}"
		rawAction("is.workflow.actions.properties.reminders", {
			"WFContentItemPropertyName": "Subtasks",
			"WFInput": "@CurRem"
		})
		for _ in Subtasks {
			const SubtaskMarkdownString = runSelf(@RepeatItem3)
			@PDFText = "{@PDFText}\n\n### {SubtaskMarkdownString}"
		}
	}
	const Text = "# {@ReminderCount} {TitleMiddleStr} *{@RepeatItem}*:\n\n{@PDFText}"
	const RichTextFromMarkdown = getRichTextFromMarkdown(Text)
	const PDF = makePDF(RichTextFromMarkdown, true)
	if @SavePDF == 1 {
		const FileName = "{@RepeatItem} PDF created {CurrentDate}"
		const FileNameOut = replaceText(":", ".", FileName)
		saveFile(FileNameOut, PDF, true)
		showNotification("At iCloud/Documents/{FileName}", "PDF saved for {@RepeatItem}", false, File)
	} else {
		quicklook(PDF)
	}
}
Декомпилировано с помощью cherri 2.3.0 (GPL-2.0). Перед компиляцией могут понадобиться небольшие исправления.

Оценки и отзывы

Написать отзыв
–
из 5
★★★★★
★★★★
★★★
★★
★
0 ratings

Пока нет отзывов. Поделись мнением первым!

Реклама

Ещё от twilsonco

См. все

Вам также может понравиться

См. все
Реклама