Login About Gallery
Sleep shortcut - Working Template
COMMENT
‎Created by @jacksondame This base template provides the building blocks for exporting a single health category out of Apple Health and into a CSV format
TEXT
‎Sleep Start, Sleep End
VARIABLES
‎Set variable ‎health data ‎to ‎Text
HEALTH
‎Find ‎All Health Samples ‎where
‎All the following are true
‎[{'class': 'filter-property', 'value': 'Type'}, {'class': 'filter-operator', 'value': 'is'}, {'class': 'filter-benchmark', 'value': 'Sleep'}]
‎[{'class': 'filter-property', 'value': 'Start Date'}, {'class': 'filter-operator', 'value': 'is in the last'}, {'class': 'filter-benchmark', 'value': '3', 'glyph': '', 'UUID': ''}, {'class': 'filter-unit', 'value': 'days', 'glyph': '', 'UUID': ''}]
‎[{'class': 'filter-property', 'value': 'Value'}, {'class': 'filter-operator', 'value': 'is'}, {'class': 'filter-benchmark', 'value': 'Asleep'}]
‎[{'class': 'filter-property', 'value': 'Source'}, {'class': 'filter-operator', 'value': 'is not'}, {'class': 'magic empty', 'value': 'Value', 'glyph': '', 'UUID': ''}]
Sort by
‎Start Date
Order
‎Oldest First
Limit
SCRIPTING
‎Repeat with each item in ‎Health Samples
HEALTH
‎Get ‎Source ‎from ‎Repeat Item
DOCUMENTS
‎Get text from ‎Source
HEALTH
‎Get ‎Value ‎from ‎Repeat Item
HEALTH
‎Get ‎Start Date ‎from ‎Repeat Item
CALENDAR
‎Format ‎Start Date
‎Options Under Construction
HEALTH
‎Get ‎End Date ‎from ‎Repeat Item
CALENDAR
‎Format ‎End Date
‎Options Under Construction
TEXT
‎Type ‎; ‎Source ‎; ‎Formatted Date ‎, ‎Formatted Date
SCRIPTING
‎End Repeat
TEXT
‎Combine ‎Repeat Results ‎with ‎New Lines
TEXT
‎Combined Text ‎health data
DOCUMENTS
‎Show ‎Text ‎in Quick Look

Showcuts

Magic Vars

Screenshot

Submitted Anonymously 4 years ago

Visit iCloud (iOS)

Copy iCloud Link

Scan QR Code

0