Loyalty Cards 1.0
COMMENT
Loyalty Cards 1.0
By robric18
COMMENT
Copy a base64 encoded version of each loyalty card into the stores subsection of the dictionary below. Click where it says 5 items the. Add store names and the encoded card. We have put some store suggestions in to get you started.
DICTIONARY

Dictionary
COMMENT
Change this value to change the radius of the search.
NUMBER
0.5

Number
VARIABLES
Set variable
Search Radius
to
Number
COMMENT
Due to a weird quirk of shortcuts, getting your location is actually much faster by first getting the current weather conditions where you are and then getting your location from the weather conditions than using the get location command. That is why these actions are used here.
LOCATION
Get current weather at
Current Location

Weather Conditions
LOCATION
Get
Location
from
Weather Conditions

Location
VARIABLES
Set variable
Current Location
to
Location
VARIABLES
Set variable
Stores
to
Stores
SCRIPTING
Get
All Keys
in
Stores

Dictionary Value
SCRIPTING
Repeat with each item in
Dictionary Value

Repeat Results
MAPS
Search for
Repeat Item
near
Current Location

Local Businesses
SCRIPTING
Get
First Item
from
Local Businesses

Item from List
MAPS
Get distance from
Current Location
to
Item from List
Route Type
Direct
Driving
Walking

Distance
SCRIPTING
If
Distance
is less than
Search Radius
SCRIPTING
Set
Distance
to
Repeat Item
in
Dictionary

Dictionary
SCRIPTING
Otherwise
NOTHING
Nothing
SCRIPTING
End If

If Result
SCRIPTING
End Repeat

Repeat Results
SCRIPTING
Get
Last Item
from
Repeat Results

Item from List
SCRIPTING
Get
All Keys
in
Item from List

Dictionary Value
FILES
Filter
Dictionary Value

Files
SCRIPTING
Repeat with each item in
Files

Repeat Results
SCRIPTING
Get
Value
for
Repeat Item
in
Item from List

Dictionary Value
SCRIPTING
End Repeat

Repeat Results
TEXT
Repeat Results
Other Card

Text
TEXT
Split
Text
by
New Lines

Split Text
SCRIPTING

Chosen Item
SCRIPTING
If
Chosen Item
is
Other Card
SCRIPTING
Choose from
Dictionary Value

Chosen Item
SCRIPTING
Get
Value
for
Chosen Item
in
Stores

Dictionary Value
SCRIPTING
Otherwise
SCRIPTING
Get
Value
for
Chosen Item
in
Stores

Dictionary Value
SCRIPTING
End If

If Result
SCRIPTING
Decode
If Result
with base64

Base64 Encoded
DOCUMENTS
Show
Base64 Encoded
in Quick Look
Showcuts