COMMENT
This shortcut is a plug in; you call it from another Shortcut. To call it use the Run Shortcut action from the other Shortcut.
Before the Run Shortcut action set up a dictionary that gets passed into Run Shortcut. The dictionary then becomes the input for this Shortcut. The dictionary has three key-value pairs:
- "variable name" | a string value.
- "method" | a string specifying if the variable is being added to memory "add" or being retrieved "get".
- "payload" | a string, number or dictionary - the data being stored for this variable.
If getting a stored variable the payload value is returned. If adding a variable to store the variable payload is added to the master dictionary using variable name as the key and the master dictionary is stored in the reminder note.
SCRIPTING
Get dictionary from
Shortcut Input

Dictionary
SCRIPTING
Get
Value
for
method
in
Dictionary

Dictionary Value
DOCUMENTS
Get text from
Dictionary Value

Text
VARIABLES
Set variable
Method
to
Text
SCRIPTING
Get
Value
for
variable name
in
Dictionary

Dictionary Value
VARIABLES
Set variable
Variable name
to
Dictionary Value
SCRIPTING
Get
Value
for
payload
in
Dictionary

Dictionary Value
VARIABLES
Set variable
Variable payload
to
Dictionary Value
TEXT
Shortcut Variables

Text
VARIABLES
Set variable
Variable storage name
to
Text
COMMENT
Retrieve the stored variable
REMINDERS
Find
All Reminders
where
All the following are true [{'class': 'filter-property', 'value': 'List'}, {'class': 'filter-operator', 'value': 'is'}, {'class': 'filter-benchmark', 'value': 'Reference'}] [{'class': 'filter-property', 'value': 'Title'}, {'class': 'filter-operator', 'value': 'contains'}, {'class': 'filter-benchmark inline', 'value': [{'class': 'magic', 'value': 'Variable storage name', 'glyph': 'assets/cat/Variable.svg', 'UUID': ''}]}] Get 1 File



Reminders
SCRIPTING
If
Reminders
does not have any value
COMMENT
Reminder not set up, set up with this var and placeholder dict
DICTIONARY

Dictionary
DICTIONARY

Dictionary
VARIABLES
Set variable
Variable storage dict
to
Dictionary
REMINDERS
Add
Variable storage name
to
Reference
with
No Alert
Options Under Construction

New Reminder
SCRIPTING
Otherwise
VARIABLES
Get
Reminders
SCRIPTING
End If

If Result
VARIABLES
Set variable
Variable storage reminder
to
If Result
REMINDERS
Get
Notes
from
Variable storage reminder

Notes
SCRIPTING
Get dictionary from
Notes

Dictionary
VARIABLES
Set variable
Variable storage dict
to
Dictionary
SCRIPTING
If
Method
contains
add
COMMENT
Add incoming payload to dictionary as “payload”
SCRIPTING
Get
Value
for
Variable name
in
Variable storage dict

Dictionary Value
VARIABLES
Set variable
Variable Dict
to
Variable Dict
DOCUMENTS
Get text from
Variable Dict

Text
SCRIPTING
Count
Items
in
Text

Count
SCRIPTING
If
Count
is greater than
0
COMMENT
Count > 0 so Dict exists
SCRIPTING
Get dictionary from
Variable Dict

Dictionary
SCRIPTING
Set
payload
to
Variable payload
in
Dictionary

Dictionary
SCRIPTING
Get dictionary from
Variable storage dict

Dictionary
SCRIPTING
Set
Variable name
to
Dictionary
in
Dictionary

Dictionary
VARIABLES
Set variable
Variable storage dict
to
Dictionary
SCRIPTING
Otherwise
COMMENT
Count = 0 so Dict doesnt exist ⇒ initialise it
DICTIONARY

Dictionary
VARIABLES
Set variable
Variable Dict
to
Dictionary
COMMENT
Since this Dict did not exist check for presence of the master Dict
DOCUMENTS
Get text from
Variable storage dict

Text
SCRIPTING
Count
Items
in
Text

Count
SCRIPTING
If
Count
is greater than
0
SCRIPTING
Get dictionary from
Variable storage dict

Dictionary
SCRIPTING
Set
Variable name
to
Variable Dict
in
Dictionary

Dictionary
VARIABLES
Set variable
Variable storage dict
to
Dictionary
SCRIPTING
Otherwise
DICTIONARY

Dictionary
VARIABLES
Set variable
Variable storage dict
to
Dictionary
SCRIPTING
End If

If Result
SCRIPTING
End If

If Result
COMMENT
Store master dictionary back to reminder
MISSING
setters.reminders Under Construction
SCRIPTING
Otherwise
COMMENT
Retrieve the payload and return it
SCRIPTING
Get
Value
for
Variable name
in
Variable storage dict

Dictionary Value
SCRIPTING
Get
Value
for
payload
in
Variable Dict

Dictionary Value
SCRIPTING
End If

If Result