I'm using the Prompt with List action successfully. However, sometimes I want to escape out of it. I've unchecked the "Abort" option in the gear menu, so it's all working correctly. However, the log shows this:
"Action 15010191 failed: Prompt With List returned without an answer"
I can deal with escape, functionally, but is there a way to avoid the message in the log?
That bugs me too, but unfortunately I’ve never found a way to keep that from being logged. That’s why I usually use a custom HTML prompt, or I simply delete the failed action entry from the KM log afterwards.
Question for @peternlewis, this is no doubt by design, but is there a possibility of changing the action’s behavior to where escaping out of it does not register as a failure?
Do you find that it seems to work to uncheck
Failure Aborts Macro and
Notify on Failure in the
^Click menu of the
Prompt with List action gear-wheel ?
Prompt with List.kmmacros (5.8 KB)
( but I see your concern is essentially with the log )
Yes. An error is always logged.
Hey @ikenassi, if you’re interested, I created a set of actions that you can place after your prompts that will remove the failed action entry from the KM Log if the prompt was escaped.
It’s early in my testing, but it works well for me in the handful of macros I’ve implemented it in. There are likely better shell scripts to do this, so if you have suggestions, please share. If you want to try it, just make sure to update the failed action ID in the shell script, and set the prompt with list action to not abort the macro on failure.
P.S.: The reason I opted to use a shell script, and not the search and replace action is because the KM action it can cause the Editor to lock up. I imagine it’s due to the real-time results it shows at the bottom of the action. Not a big deal if you keep it collapsed, but if you need to expand or type in it, it’s a real PITA.
Thanks. Here’s the one I independently wrote:
Oh man I like that because I don’t even need the action ID. Thanks for sharing, I’m gonna modify mine now.
Update: I used a little of yours with a little of mine, and added a little extra. This way it should remove only the failed action at time of execution (instead of all lines that contain that text), thanks to the date/timestamp variable. It works for me so far... though I imagine if there is any kind of significant delay between the end of the prompt with list action execution and the shell script execution, the variable may be off by a second or so and not remove the entry. I’ll know more as I continue to test.
# set date and time to variable for single entry removal
dateStamp=$(date "+%Y-%m-%d %T")
# remove failed action line from KM Engine Log, outputting to temp file
sed "/$dateStamp.*Prompt With List returned without an answer/d" /Users/$USER/Library/Logs/Keyboard\ Maestro/Engine.log > /Users/$USER/Library/Logs/Keyboard\ Maestro/temp.log
# replace previous Log with modified temp file
mv /Users/$USER/Library/Logs/Keyboard\ Maestro/temp.log /Users/$USER/Library/Logs/Keyboard\ Maestro/Engine.log
I like it!