Question about automated screenshots features

By DrWh0

Hero (651)

DrWh0's picture

25-07-2018, 19:05

Hi everyone

Sorry if this sound silly but, i have a question regarding commandline:

Is there any command line option to force openmsx to load a rom, take a screenshot after a specific time in seconds and close the emulator after taking that screenshot without user intervention?

My idea is making a batch file to get all the names of a folder, make a list and open openmsx take a screenshot after XX seconds.

P.D.:
I already know that internal command console of openmsx can do automated screenshots and internal operations but It can´t make an automated process taking all the roms in a folder and needs tcl programming

Thanks in advance

Login or register to post comments

By Manuel

Ascended (14470)

Manuel's picture

25-07-2018, 22:21

This is possible with a command line that also includes a small Tcl script.

Make a text file containing the following:

set throttle off
after time 15 { screenshot -guess-name; exit}

Name this file whatever you like, e.g. autoscr.tcl and start up openMSX from your batchfile like this:
openmsx WHATEVERYOURROMFILEIS -script autoscr.tcl
of course, fill in the proper parameter for the ROM file where I put WHATEVERYOURROMFILEIS.

Tweak the script file as you wish: 15 is the time in seconds after starting up after which the screenshot is taken and openMSX exits. With the -guess-name option, I let openMSX make a nice filename for your screenshot. openMSX will still make sound, if you don't like that, add a line at the beginning with set mute true.

Enjoy and let me know if you have questions.

And yes, it is possible to do this from one single Tcl script, but you rather program a batch file (that would be slower, but maybe you don't care about that), that's all your choice Smile

By DrWh0

Hero (651)

DrWh0's picture

25-07-2018, 23:13

Thank you Manuel

I thought that tcl scripts were more complex that using console commands on a text file (I saw a couple of complex tcl and I thought that it should be easier) and documentation sometimes is a bit confusing regarding to the creation of it.

I will do it in that way

Thanks again Smile

By Manuel

Ascended (14470)

Manuel's picture

26-07-2018, 00:02

The openMSX console is basically a Tcl shell. So everything you write in there is valid Tcl. So a bunch of console commands are also a simple Tcl script.

If there is something specific in the documentation that can be improved, please point me to it and I'll improve it.

My MSX profile