Is there a way to append Display Text to have a single record of all messages from a macro?

I'm would like to be able to see all the diagnostic message that I output from a macro I'm debugging all at once. Display large is intrusive and nonpersistent. Display briefly is just that, brief, sometime way too brief when I'm trying to watch what else the macro is doing.

Display in a window is what I use mostly, but I get a separate window for every line. I would really prefer to have all of those lines in one window so that I could look through the notifications of actions and variable values chronologically, in one place.

When debugging shell macros in the terminal, I can just echo each line of text to STDOUT and they show up in the terminal, or I can append them to a file and either open the file when the macro completes, or open another terminal window to read from that file as it gets added to.

Any suggestions for how to do this in KBM?

Thanks.

Perhaps instead of having the text display in a window after each action, just append that same text to a variable which is then displayed at the end of the macro.

Thanks Chris.

That would work, I think, except for whenever the macro aborts, which is often the case when I'm trying to debug it.

I did find Append Text to File, which is a variation of Write to File. So if I can just remember how to get a terminal window to track additions to a file, that might do it.

Hey appending to a text file is an even better idea, since you could keep long-term records, and as you said, even if the macro aborts, at least you have the results up to the point it aborted.

I wouldn't know how to accomplish what you need with Terminal since I don't use it very often, but likely somebody else here does.

Hi @August, you might want to check out my utility described here:

It will do what you want but then a bit more!

I just thought of something else. You might look into this wiki page about the Action Result token. It gives some examples of how you could use a failed macro that was aborted to give you a notice that it canceled and likely show you your log up to that point in time.

EDIT: It looks like @tiffle checkpoint system might be just what you're looking for actually. I'm gonna finish reading the page he linked to and I might just incorporate it into my debug workflow too :sweat_smile:

The Terminal answer is the tail utility with the -f option.

tail -f <filename> is probably what you're looking for. The -f switch means "follow." It will keep the tail command open, printing out new lines as they are added to the end of the file you're tracking.

Use the Log action, and tail -f Engine.log in the Logs folder (Help, Open Logs Folder).

tail -f ~/Library/Logs/Keyboard\ Maestro/Engine.log

Or you can use a Custom HTML Prompt action.

1 Like

I didn’t even know this Log action existed. And I’ve been trying to read every page of the wiki site one by one for a couple months now. I just keep on discovering that there’s still a lot more depth to this rabbit hole :laughing:

2 Likes

:sunglasses:

I've been using Keyboard Maestro daily at a high level since 2004.

That's what – 17 years plus?

I still don't know everything there is to know about it – nor do I remember everything I've ever learned about it or done with it.

Keep good notes when you do complex things you're likely to forget tomorrow, next week, next month, next year, or 10 years from now.

-Chris

4 Likes