Hey guys! Appreciate the words of wisdom, I'll be rereading them again now. But since you asked, first I wanted to just share a glance at the project I'm working on to show you how nuts things are getting.
I don't suggest you waste too much brainpower looking closely at the macro, it's just to give you a quick glance into the self-inflicted craziness I'm dealing with! If you don't have the mental energy to dissect all of this, no sweat. Just wanted to also share with others what kind of complexity is possible with some severe nerding out with KM.
It's kind of one of those things were my use case is so extreme that I almost need to start writing custom software.. but since my coding skills are lame and mostly limited to basic PHP / Javascript, I've been working with what I know how to use (KM).
So, the screenshots - the macro screenshot is of the main Macro that has tons of nested groups, Execute Macro actions, If loops etc. (It was too big to upload so I reduced it... not sure if the forum reduces it further or if you'll be able to read it or not..)
The other screenshot is a folder of macros that mostly support that one main macro. You can see my attempt at a naming convention. "z_" shoots the items to the bottom of the list since they are not usually triggered individually but rather via another macro. The ones with "_" prefix are the main macros that I do trigger manually.
Also including some screenshots of the spreadsheet from which the content originates, and screenshots of the finished product just to give you an idea of what is accomplished.
I'll briefly explain the goal behind all the craziness. This is for a bootstrap language learning platform (for European Portuguese learners). The site runs off a wordpress quiz plugin.
Here is the gist of what these macros accomplish. Again, don't get too lost in the details, this is just a rough overview:
• Captures a spreadsheet (will multiple sheets) from excel, saves everything into a KM variable
• Using regex and For loops, it processes each set of lines that pertain to lessons/quizzes for our site. Each line generates 5 or 6 different kinds of questions using the same set of translation pairs, eg. Drag to Sort, Multiple Choice, Fill in the blank. Some questions prompt the user to translate from English to Portuguese, and others the opposite.
• Each Portuguese phrase within each line renames a jpg file as needed from a bunch of images have in a folder, renames them accordingly. It also generates small mp3 files using speech synthesis with the help of Automator and a terminal command.
• If the macro determines that a Lesson or a Unit is new and hasn't yet been created in Wordpress, it creates the new post in Wordpress. It also creates a new Quiz (a custom post type that the plugin uses) and saves its quiz ID for later to associate the questions with the correct Quiz it belongs to.
• The macro uses sub macros "Q1, Q2" etc to generate each type of question, writing them to a .csv file.
• Once everything is done, I upload the folder of mp3 files, jpgs, then through phpmyadmin, I import the CSV files directly into the mysql database. (I used to have KM creating every individual question through Safari in Wordpress but with thousands of questions, this would take hours each time I wanted to update the content! Direct mysql import is much faster).
So as you can see, I have ducttaped together a very complex, daisychained set of macros. If I knew what I was doing, one day it would be amazing to make it so that these spreadsheets could just live inside Wordpress and have all the individual questions and content be generated dynamically instead of hardcoding everything into a file that's imported into mysql. But for now everything is working and we have happy customers making use of the quizzes.
I wouldn't have been able to dream of putting together something this complex if it weren't for KM. According to the About window, it would have taken me 2190 Years to generate all this content manually