{
"name": "Peter Griffin", // imovie placeholder title spot #1
"familyRole": "The Father", // imovie placeholder title spot #2
"image": "image.jpg" // imovie placeholder image spot #1
}
Lois/character.json:
{
"name": "Lois Griffin",
"familyRole": "The Mother",
"image": "image.jpg"
}
Stewie/character.json:
{
"name": "Stewie Griffin",
"familyRole": "The Baby",
"image": "image.jpg"
},
With the first video created for Peter manually using data from the first json, we export it as Peter_Griffin.mp4. How can we automate this task so we can automatically create 2 more videos Lois_Griffin.mp4 and Stewie_Griffin.mp4 each video using it's respective character.json and image?
Visual Explanation:
Here is an image to help describe what we're trying to do programmatically/via an automatic workflow:
The static zones should not change, the other parts should be derived from the json data. So if we save and export the following video for Peter, how can we automatically have the videos for Lois/Stewie auto created/saved/exported as well? Is this something KeyboardMaestro can automate?
Thank you hello. I am new to Keyboard Maestro and found the JSON part a bit complicated (getting values from a JSON file in a directory).
Here is a simpler example that will really help with understanding how KM works. Any idea how setup Keyboard Maestro to:
Start from the root folder FamilyGuy
Iterate over each available subfolder Peter/Lois/Stewie
Open subfolder/character.json and grab values for "name" and "familyRole"
Open TextEdit app, paste in the values for "name" so it says (Peter Griffin) on the first line, and "familyRole" so it says (The Father) on the second line. Save file as Peter_Griffin.rtf in subfolder.
Sorry for the newbie question. This tool seems very powerful, but a bit hard to grasp from the JSON file as a source while iterating over the subfolders and saving a new file in each subfolder based on the derived json values.
Thank you so much for your help hello. Grabbing JSON values and pasting them in TextEdit is trivial now after going through your JSON actions example. It works when we explicitly specify a subfolder "Read File to Variable "JSON"" with a Read File path of ~/Downloads/FamilyGuy/Peter/character.json. But to set "FamilyGuy" as a source folder and have KM go thru each subfolder Peter/Lois/Stewie I tried using the different "Each" actions available but they ask for a variable, not sure what to do there. I am trying to loop thru each subfolder to save Peter_Griffin.rtf/Lois_Griffin.rtf/Stewie_Griffin.rtf in their respective subfolder. Any idea how to do this?