Accepts
App Store Apps, Articles, Contacts, Dates, Email Addresses, WFFolderContentItem, Files, Images, iTunes Products, Locations, Map Links, Media, PDFs, Phone Numbers, Rich Text, Safari Web Pages, Text and URLs
COMMENT
The way this loop has been build, it runs the shortcut over and over. Based on the values FN and BK.
SCRIPTING
Get dictionary from
Shortcut Input

Dictionary
SCRIPTING
Get
Value
for
FN
in
Dictionary

Dictionary Value
COMMENT
➡️ the FN is empty on the first run, this IF statement sets the value to Mainmenu. This way the Main menu is shown on the first run
SCRIPTING
If
Dictionary Value
does not have any value
TEXT
MainMenu

Text
VARIABLES
Set variable
FN
to
Text
SCRIPTING
Otherwise
VARIABLES
Set variable
FN
to
Dictionary Value
SCRIPTING
End If

If Result
SCRIPTING
Get
Value
for
BK
in
Dictionary

Dictionary Value
COMMENT
➡️ BK same story, you can’t go back to a menu on the first run. So if the user taps back in the main menu this IF statement sets the value to MainMenu so that the MainMenu is shown.
VARIABLES
Set variable
BK
to
Dictionary Value
DICTIONARY

Dictionary
VARIABLES
Set variable
LocalData
to
Dictionary
VARIABLES
Set variable
ReRun
to
LocalData
COMMENT
⚓️ The ReRun functions as anchor to tell the shortcut where to run from. However the shortcut always runs from the top and not from here, but without it it doesn’t work.
SCRIPTING
If
FN
is
MainMenu
SCRIPTING
If
BK
does not have any value
TEXT
BEGIN:VCARD
VERSION:3.0
N;CHARSET=utf-8:UserMenu;;;;
ORG;CHARSET=utf-8:;
PHOTO;ENCODING=b:;
END:VCARD
BEGIN:VCARD
VERSION:3.0
N;CHARSET=utf-8:SettingsMenu;;;;
ORG;CHARSET=utf-8:;
PHOTO;ENCODING=b:;
END:VCARD

Text
SCRIPTING
Otherwise
TEXT
BEGIN:VCARD
VERSION:3.0
N;CHARSET=utf-8:Back;;;;
ORG;CHARSET=utf-8:;
PHOTO;ENCODING=b:;
END:VCARD
BEGIN:VCARD
VERSION:3.0
N;CHARSET=utf-8:UserMenu;;;;
ORG;CHARSET=utf-8:;
PHOTO;ENCODING=b:;
END:VCARD
BEGIN:VCARD
VERSION:3.0
N;CHARSET=utf-8:SettingsMenu;;;;
ORG;CHARSET=utf-8:;
PHOTO;ENCODING=b:;
END:VCARD

Text
SCRIPTING
End If

If Result
SCRIPTING
Set name of
If Result
to
MainMenu.vcf

Renamed Item
SCRIPTING
Choose from
Renamed Item

Chosen Item
SCRIPTING
If
Chosen Item
is
Back
COMMENT
➡️ BK is set to Main Menu here and brings the user back to Main Menu.
➡️ FN when the user chooses something different then back. The selected item is set as FN and MainMenu is assigned to BK.
This tells the shortcut go to [ selected menu ] and the menu before this was MainMenu.
DICTIONARY

Dictionary
SCRIPTING
Otherwise
DICTIONARY

Dictionary
SCRIPTING
End If

If Result
SHORTCUTS
Run
ReRun

Shortcut Result
SCRIPTING
Exit shortcut with
Result
SCRIPTING
End If

If Result
SCRIPTING
If
FN
is
UserMenu
SCRIPTING
If
BK
does not have any value
TEXT
BEGIN:VCARD
VERSION:3.0
N;CHARSET=utf-8:MainMenu;;;;
ORG;CHARSET=utf-8:;
PHOTO;ENCODING=b:;
END:VCARD
BEGIN:VCARD
VERSION:3.0
N;CHARSET=utf-8:SettingsMenu;;;;
ORG;CHARSET=utf-8:;
PHOTO;ENCODING=b:;
END:VCARD

Text
SCRIPTING
Otherwise
TEXT
BEGIN:VCARD
VERSION:3.0
N;CHARSET=utf-8:Back;;;;
ORG;CHARSET=utf-8:;
PHOTO;ENCODING=b:;
END:VCARD
BEGIN:VCARD
VERSION:3.0
N;CHARSET=utf-8:MainMenu;;;;
ORG;CHARSET=utf-8:;
PHOTO;ENCODING=b:;
END:VCARD
BEGIN:VCARD
VERSION:3.0
N;CHARSET=utf-8:SettingsMenu;;;;
ORG;CHARSET=utf-8:;
PHOTO;ENCODING=b:;
END:VCARD

Text
SCRIPTING
End If

If Result
SCRIPTING
Set name of
If Result
to
UserMenu.vcf

Renamed Item
SCRIPTING
Choose from
Renamed Item

Chosen Item
SCRIPTING
If
Chosen Item
is
Back
DICTIONARY

Dictionary
SCRIPTING
Otherwise
DICTIONARY

Dictionary
SCRIPTING
End If

If Result
SHORTCUTS
Run
ReRun

Shortcut Result
SCRIPTING
Exit shortcut with
Result
SCRIPTING
End If

If Result
SCRIPTING
If
FN
is
SettingsMenu
SCRIPTING
If
BK
does not have any value
TEXT
BEGIN:VCARD
VERSION:3.0
N;CHARSET=utf-8:UserMenu;;;;
ORG;CHARSET=utf-8:;
PHOTO;ENCODING=b:;
END:VCARD
BEGIN:VCARD
VERSION:3.0
N;CHARSET=utf-8:MainMenu;;;;
ORG;CHARSET=utf-8:;
PHOTO;ENCODING=b:;
END:VCARD

Text
SCRIPTING
Otherwise
TEXT
BEGIN:VCARD
VERSION:3.0
N;CHARSET=utf-8:Back;;;;
ORG;CHARSET=utf-8:;
PHOTO;ENCODING=b:;
END:VCARD
BEGIN:VCARD
VERSION:3.0
N;CHARSET=utf-8:UserMenu;;;;
ORG;CHARSET=utf-8:;
PHOTO;ENCODING=b:;
END:VCARD
BEGIN:VCARD
VERSION:3.0
N;CHARSET=utf-8:MainMenu;;;;
ORG;CHARSET=utf-8:;
PHOTO;ENCODING=b:;
END:VCARD

Text
SCRIPTING
End If

If Result
SCRIPTING
Set name of
If Result
to
SettingsMenu.vcf

Renamed Item
SCRIPTING
Choose from
Renamed Item

Chosen Item
SCRIPTING
If
Chosen Item
is
Back
DICTIONARY

Dictionary
SCRIPTING
Otherwise
DICTIONARY

Dictionary
SCRIPTING
End If

If Result
SHORTCUTS
Run
ReRun

Shortcut Result
SCRIPTING
Exit shortcut with
Result
SCRIPTING
End If

If Result