Publishing from the Command Line
Publishing from the command line enables you to automatically publish one or more books in a batch or as part of a scripted or scheduled process. Author-it will even create the command line parameters for you - meaning you don't even need to look up the correct syntax.
- Open the Publishing window and select the Books and output formats you wish to publish.
- Right-click and choose View Command Line.
- A window appears displaying the Command Line parameters based on your selections. You can copy and paste the parameters as required.

Syntax
aitpublisher[.exe] libraryname [ /user /pwd ] [ /pub book|output[;book|output...] [/min] ] [/exit] (/returncode)
The parts of the command line switch syntax are:
|
|
|
Argument
|
Description
|
aitpublisher
|
The path to the Author-it Publisher program.
|
libraryname
|
The type, name and path of your Author-it Library (.adl) file. Author-it will open this library when found.
For example:
/jet"C:\Program Files\AuthorIT V4\Data\Libraries\Sample.adl"
-or-
/sql"AuthorIT2|server1"
|
user
|
User account to sign into the Author-it Library database.
|
pwd
|
Password used to sign into the Author-it Library database.
|
/pub
|
Tells Author-it to publish documentation in the specified library using the book and output list.
|
book
|
The ObjectID of the book you want to publish in the library.
|
output
|
Specifies the output(s) you want to publish. This parameter is the sum of the format identifiers, where:
- Word Document = 1
- Windows Help =2
- HTML = 4
- XHTML = 8
- HTML Help = 16
- Java Help = 32
- Oracle Help = 64
- PDF = 128
- DITA = 256
- XML = 512
- Author-it Website Manager = 1024
To publish Word, HTML, and HTML Help you would add 1 + 4 + 16, and specify 21.
To publish all outputs you would specify 2047 which is the sum of them all.
|
/min
|
Tells Author-it to minimize during publishing. An icon displays in the Windows Taskbar while it is running.
|
/returncode
|
cause the publisher to return a "return code", as follows:
|
|
0
|
if publishing was successful
|
|
1
|
if an error or warning occured during publishing (including the cancel button being selected)
|
|
This allows automatic publishing to be used in a batch file and the success or failure can be used to branch in a batch file, as follows:
PUBLISH.BAT
@echo off
echo Starting Publisher - Book 5830 to WinHelp
"C:\Program Files\AuthorIT V4\AITPublish.exe" /jet"C:\Program Files\AuthorIT V4\Data\Libraries\MyLibrary.adl" /pub"5830|2;" /exit /returncode
If ERRORLEVEL 1 GOTO RET1
echo Publishing has worked
GOTO END
:RET1
echo Publishing has failed
GOTO END
|
/exit
|
Tells Author-it to close and exit after publishing is complete.
|
Note: When used, these arguments must be in a command line to run the Author-it Publisher. The statement must all be on the same line.
Example:
An example of a valid command line that runs Author-it, loads a specific JET library, publishes all outputs for a book, and exits, may look like:
"C:\Program Files\AuthorIT V4\aitpublish.exe"/jet"C:\Program Files\AuthorIT V4\Data\Libraries\Sample.adl" /pub"275|1023" /min /exit
|