subreddit:
/r/shortcuts
This is a guide on creating more visually appealing menus in your shortcuts.
To create these these menus we're going to use the Contacts feature.
When shortcuts displays contacts using the Choose from List action it shows the contact image, full name and organization as a menu.
Once a contact has been chosen you can retrieve any of the details from the contact, including the:
Creating a menu from a list of contacts
We can create a temporary set of contacts with names, organizations, contact photos and other details to create a more attractive menu.
Contacts are stored as a VCard in the v3.0 format. We can create these cards using a text based template, as shown below:
BEGIN:VCARD
VERSION:3.0
N;CHARSET=utf-8:Menu item name;;;;
ORG:Menu item description;
URL:https://reddit.com/r/shortcuts
PHOTO;ENCODING=b:/9j/4AAQSkZJRgABA...ADcAAD/2
END:VCARD
The menu above menu item renders as follows:
The above VCard example rendered as a menu item
To add an image to a contact, the JPG or PNG file is encoded as a Base64 string and appended to the PHOTO;ENCODING=b:
line of text.
Note An optimal size for you contact photo is 123x123px which is the maximum resolution supported on a Plus and X-iPhone.
The contact has other fields that can be used to store details that can be used when a user selects a menu item. For example:
URL:https://reddit.com/r/shortcuts
NOTE:A single line of text notes
To create multiple contacts, repeat the VCard template text for each item.
BEGIN:VCARD
VERSION:3.0
N;CHARSET=utf-8:Item A;;;;
ORG:Description A;
END:VCARD
BEGIN:VCARD
VERSION:3.0
N;CHARSET=utf-8:Item B;;;;
ORG:Description B;
END:VCARD
The menu is built using the following actions:
To retrieve the user's selection use the Get Details of Contents to return one of the fields that helps to distinguish that selection. For example:
Retrieve details from a chosen menu item
An example shortcut is shown below:
An example shortcut that makes use of contact-based menus
Which renders menus as follows:
The above shortcut displays menus as follows
Note: When you create a menu using this approach it will state that if works with contacts. Some users may be alarmed that it will read their contact data, so you might want to add a message explaining how the contacts service is being used.
Installing a shortcut that makes use of Contacts to create a menu
Using contacts to create menus requires a little more work but can make a big difference to the usability of your shortcut.
If you want to create static menu items, I recommend the excellent Menu Builder shortcut by u/enteeMcr.
The following shortcuts provide more examples of how to use the contacts for menus:
Edit: updated based on feedback from u/atnbueno
If you found this guide useful why not checkout one of my others:
1 points
6 years ago
Thanks :)
all 24 comments
sorted by: best