Reply To: Scripting Study Group – 2021

Home of the Scrapbook Campus Forums Study Group Scripting Study Group – 2021 Reply To: Scripting Study Group – 2021

#66003
Cassel
Keymaster
  • 1834
  • Superfan

How do we know whether to use the Tupperware Container or the Recipe?

That is a good question. A variable can replace either a dictionary or a key:value pair. You can use either one but it is simpler to assign a variable to what you will be using, as it is often shorter and you can make it anything that will be easier to remember.

If you look at the code when you record it, look at what you will be replacing (sorry but the formating is not kept in here):

‘Fill’: {
‘Color’: None,
‘Pattern’: None,
‘Gradient’: None,
‘Texture’: None,
‘Art’: None
},

can become this if you use the material selected by the user (or your own):

‘Fill’ : Material

or maybe you want to only pick a specific color, for example:

‘Fill’: {
‘Color’: Material,
‘Pattern’: None,
‘Gradient’: None,
‘Texture’: None,
‘Art’: None
},

In the first example, you will be using the whole dictionary, while in the second example, you will need a key:value. Both can be assigned to the variable Material (of course, it might be better to be more specific in the variable name!)