Hi Ryo,
I don't know why what you are trying is not working; this is what
-batch is intended for. My experiments with commands such as you
show seem to be working ok. You could try what you're doing but
with the postscript batch option, which will write a postscript
file, but also execute your metafile commands.
# Call Ferret many times, changing the parameter n
ferret -batch dummy.ps -script myscript.jnl $n
Ferret's batch modes store the graphics outputs to files. The
-gif startup option saves graphics command outputs directly to the
gif file. And 'batch' mode needs somewhere to have the graphics
outputs going; either a postscript file or metafile. It doesn't
just store that info in memory, as PyFerret does in its -nodisplay
mode.
Moving forward I hope you'll use PyFerret. Then your script
would not need metafile commands (though pyferret will ignore
metafile commands that may be in your existing scripts), and there
doesn't need to be any translation to a metafile to pdf or
postscript, but only a FRAME command with the right file type.
The call would look like:
pyferet -nodisplay -script myscript.jnl $n
and the script would need only:
[plot commands with argument ($1)]
frame/file=filename_($1).pdf
On 12/17/2018 12:28 AM, Ryo Furue
wrote:
Dear Ferret users,
I was wondering how to prevent the Ferret window to steal
the focus.
I guess I need a version of the "-batch" command line
option that doesn't try to redirect the metafile output, but
there may be other solutions.
I have a self-contained Ferret script that looks like
set mode metafile
. . . plot something . . .
cancel mode metafile
ppl clsplt
SPAWN . . . shell commends to process the metafile
to produce PDF . . .
The problem is when I call it from within a shell script
repeatedly
# Call Ferret many times, changing the parameter n
ferret -script myscript.jnl $n
Ferret shows a window each time it's invoked, which steals the mouse focus. So,
basically, I can't do anything while the script is running.
I thought I could use a fake "-batch" option as in
ferret -batch metafile.plt -script myscript.jnl $n
but it fails. I don't know exactly how, but it doesn't
probably interact well with "set mode metafile" within the
script.
Would it be easy to implement a version of -batch option
that does nothing but to suppress window output or a version
of -gif option to allow metafile?
Regards,
Ryo