If I would have to write such a program that can run in batch mode or with a UI interface, I would implement a unique program with --silent mode, to run the program in batch mode or in interactive mode.
In interactive mode, you can then use ui.Interface.refresh() to display information to the end user (show progress bar, reload a table with log records, etc).
If your program will be executed as a scheduled job in background, you could write to a log file or to an SQLite database, and have a secondary UI program displaying the progress by reading the log or the db, using ON IDLE 2 or 3 secs, to refresh information displayed to the user... In this UI program you can also implement filters or search facilities to find information in the logs.
Seb
Thank you. I'll keep these pointers in mind when modifying the program to run in batch mode.