I think I'm more of a Beta now than a prototype. Here's the action:
And here's the primitive result:
I'm still working on some issues, but this is a good start.
I'm trying to return the results of the choices from the Custom HTML action. Currently my HTML code can return a string constant, but I can't get it to return any other string, such as the Choice1 variable that my HTML created for the first choice:
<!DOCTYPE html>
<html>
<body>
<select name="Choice" id="Choice1">
<option value="Dear">Dear</option>
<option value="Hello">Hello</option> </select>
<select name="Choice" id="Choice2">
<option value="Sleepy Dwarf">Sleepy Dwarf</option>
<option value="Dan">Dan</option> </select>
Good Day! <select name="Choice" id="Choice3">
<option value="Regards">Regards</option>
<option value="Love">Love</option> </select>
Santa
<form action="/action_page.php">
<button name="OK" type="button" onclick="window.KeyboardMaestro.Submit('MyResult')">OK
</button>
</form>
Can anyone explain how to replace the string 'MyResult' with the result of a single HTML variable like Choice1? (Hmm, did I get the "name=" and "id=" values swapped? Testing it now.)
I'm still on a steep learning curve, but I think the solution hinges on returning the concatenated value of all the text (including the text from the menus) in the submit button's onclick event handler. The only problem I'm stuck on at the moment is returning the value of one of the menu items.
I can see a second way to solve this, which is to place all the constants and variables into a KM dictionary and then instead of returning a value, let the user assemble the value from the dictionary. I'll save this technique for version 2. For now, I'm just struggling to return a single variable.
EDIT: Okay, after hours of struggles, I think I found a way to proceed. I doubt that it's the only or best way, but at least it's a way.
EDIT: Okay, I have a functioning beta macro now. It's output isn't very pretty, because I don't know much about creating styles in HTML, but at least it's functioning. I've spent hours working on this, so I'm going to take a break before deciding what to do next. I'll probably post it on its own thread this week.