Copying dictionary template to re use

shortcuts
#1

Hi Guys,

I have a Calendar shortcut that I found somewhere and modified for my own needs. I wanted to add an entry just now and couldn’t find anyway to copy one to the other and ended up having to re type it all manually. I’ve recreated it as best I can down below. What I would like is a way to copy the headers to a new entry so I can just enter the relevant details. Is this possible?

Dictionary
Doctors appointment: 6 items
Calendar (text)
Location (text)
Duration (text)
Notes (text)
All Day (Boolean)
Alert (text)

0 Likes

#2

If you are duplicating within a shortcut and want to add to the same shortcut, tap on the action header and select “Add to this shortcut”.

If you are creating a new shortcut, you could duplicate the existing one on the list page by selecting edit, tapping the original shortcut, then the duplicate button at the top.

Another way that can work anywhere involves using a particular format known as JSON. Dictionaries can be expressed in plain text in JSON format. But rather than having to know how to build it, you can just build the dictionary as normal, then add a copy to clipboard action. This will automatically convert it.

To change it back, use a Get Dictionary from Input action. This means you can convert it, paste it into a text action anywhere you like, modify the content (it isn’t difficult), and then use the Get Dictionary from Input action to prepare it for use.

To illustrate this I put together a little example

Hope that helps.

3 Likes

#3

Thanks, I didn’t know about the “duplicate within shortcut” so that was very useful.

I’ve installed your shortcut and will look through it more thoroughly a bit later. I was struggling to explain myself in my original post but the dictionary you’ve created has the headings I mentioned as individual entries whereas mine has them as a sub category of the original heading so for example

Doctor appointment

Calendar, Location, Duration, Alert, Notes etc

So I have a bunch of these in the shortcut for example doctors, dentist, physio, client sites etc I would love to give this to other people I know in my life but there has to be a way to tap “Doctors” copy it and have the sub categories auto filled out ready to go.

0 Likes

#4

Exactly the same principles apply. The content of the dictionary is irrelevant in regards to the techniques as they concern the top most dictionary level.

Once you have the text, you can even copy and paste within the dictionary JSON to replicate entries within it… which I guess might be another interpretation of what you originally asked for.

If you want to copy a dictionary within a dictionary, either JSON it all and trim it down or just grab the sub dictionary you want and apply it to that.

1 Like