Contents | Start | End | Previous: Chapter 2: Script Syntax | Next: Chapter 4: Using HTML Templates
This chapter describes how to use the command line to drive Jutoh’s scripting facility.
When running Jutoh from the command line, you can specify a Jutoh project file name (.jutoh) or a Jutoh script file name (.jutohscript).
You can specify switches in a long or a short form. The long form uses two dashes, and the short form uses a single dash or a forward slash. Where a parameter is specified, it is separated from the switch by equals (‘=’).
These are the switches you can use:
--output=filename (-o=filename)
Writes log information and errors to the specified file.
--append=filename (-a=filename)
Appends log information and errors to the specified file.
--info (-i)
Writes verbose informational output, only when writing to a log file.
--batch (-b)
Reduces GUI prompting to a minimum, and exits after processing. Some GUI will still be shown.
--quiet (-q)
Shows no GUI in batch mode.
--help (-h)
Shows help on command line switches.
--version (-v)
Shows the Jutoh version number.
--local-settings (-l)
Specifies that the application settings should be stored in a data file next to the Jutoh executable.
--display=hostname:displaynumber.screennumber
This is available on Linux and other X11-based operating systems only. The value is normally :0.0. This overrides the value of the DISPLAY environment variable. You can use this argument to redirect display output, for example to a virtual display such as Xvfb.
When executing a Jutoh script, you are likely to specify --batch, and one of --output or --append to save the log to a file. The --batch switch will cause Jutoh to execute the script and return after processing. Specify --quiet to ensure that the processing is not interrupted by dialogs.
For example:
jutoh --append=log.txt --batch --quiet MyScript.jutohscript
On X11-based systems, you can use Xvfb to run Jutoh without the need for a physical display. Use the xvfb-run command to simplify the use of Xvfb and Jutoh. For example:
xvfb-run jutoh --batch myscript.jutohscript
This runs the virtual display, then runs Jutoh using this display (by setting the DISPLAY environment variable). When Jutoh terminates, so does Xvfb.
On Mac OS X, you can use the ‘open’ command to run Jutoh with command line arguments, passing -W to wait until processing has terminated. For example:
open -W Jutoh.app --args myscript.jutohscript --batch --quiet
Please note that if running a script by clicking it within Finder, Jutoh may hang during script execution, so it’s best to run it by opening the script from File | Open in Jutoh.
In a Windows command window, you can use start /WAIT to return control to the script only when processing has terminated. For example:
start /WAIT jutoh.exe myscript.jutohscript --batch --quiet
This chapter has covered the details of running Jutoh on the command line. Next, we look in detail at the use HTML templates for adding code and custom HTML.
Contents | Start | End | Previous: Chapter 2: Script Syntax | Next: Chapter 4: Using HTML Templates