I apologize if some of my terminology is off here. I am trying to construct the following macro:
Prompt for user input.
Execute subroutine to dynamically generate another user prompt based on user input from the initial prompt.
Execute dynamically generated prompt.
I have this entirely constructed, but with one problem–step three's action was loaded into RAM at the beginning of the macro execution, therefore the dynamically generated user prompt will not populate until the next execution. All this to ask: is there a way to force the KM engine to reload a macro into RAM mid-execution?
Please let me know if I can clarify anything. Thanks!
Yes, I have been calling step three with an "Execute Macro" action, and it still preloads, unfortunately. I also tried executing from an AppleScript to no avail.
Thanks for the idea! I just tried running step three asynchronously, and enclosing the whole macro within another macro then running that asynchronously–still no dice.
I figured Peter might be the only one with a definitive answer here I am creating the dynamic prompts by modifying an XML with variable input, and then importing the XML via AppleScript.
I've attached a test package for anyone interested. "User Prompt - RUN ME" replicates the three steps in the initial post.
I have no idea what you are doing, but @AlexGerbrandt’s suggestion would be my suggestion - if you want to create a dynamic action, create it’s XML and execute that via AppleScript.
@noisneil I am generating various checkboxes/menus/text fields/buttons on a dynamic basis. I'm happy with the implementation, but check out the package below if you're interested. I would love to know if there is a way to do this without the XML > AppleScript import process.
Hi @peternlewis, I think the primary quandary here is not the XML editing/macro importing, but rather whether one might be able to run the newly imported macro from within the same execution during which it was imported. Any ideas there?
@Airy, I definitely don't hate this idea! However, it solves only about a quarter of my problem. I have never used the prompt for snippet action before. This would be the perfect solution if it supported custom checkboxes, menus, added buttons, etc.. I love that you have more flexibility over the prompt layout with snippets. @peternlewis any chance this functionality could be added to the snippet action in the future?
This might be the wrong track, but instead of trying to build a custom Prompt for User Input on the fly, why not just create a Custom HTML Prompt? They can have all of those items (it's just HTML, after all), and they can return their input to the macro.
No need for XML real time injection, just gather your data, pass it as inputs to the Custom HTML Prompt, then get the results back when the form is submitted. It'd take some HTML/CSS setup work, of course, but it seems easier to me than making a self-modifying macro :).
I understand and agree with you that those features would be nice. But when I wrote my post I didn't see any mention of those requirements in your original post. You simply said "user input", you didn't mention buttons, menus or checkboxes.
Even so, my idea might help some people with similar problems, so I'm still happy with it.
@Airy –my apologies–I didn't intend to put down your response. I'm very thankful you pointed out snippets to me. I'm looking forward to using in the future! Take care!
@griffman, you've unlocked a whole new world of possibilities for me! Thank you! Off to polish up on HTML and CSS now...
@peternlewis – Aha! Excellent, this is exactly what I was looking for!