Publishing from the command line allows you to automatically publish one or more books in a batch or as part of a scripted or scheduled process. Author-it creates the command line parameters for you so you don't need to look up the correct syntax.
- From Publishing console, select the profile and books you want to publish.
- Click the Show Command Line button
From the shortcut menu, click Show Command Line.
A window appears displaying the command-line parameters based on your selections.
- Copy and paste the parameters as required.
Best Practice: Creating syntax for books and variants
When using the command line to publish, you can define the syntax to include multiple books. If you are adding variant criteria to the command line, create the syntax so it refers to a single book. Publish multiple book by running them in a batch file.
- Multiple books:
Authorit[.exe] libraryname [ /user /pwd ] [ /pub book|profile;book|profile... ] (/returncode)
- Single book with variants:
Authorit[.exe] libraryname [ /user /pwd ] [ /pub book|profile ] [ /variant name|value;name|value... ] (/returncode)
- Assigning variables via the command line to publish a book that has prompt on publish variables in it, and specify the variable assignments via the same command:
/variant “variable1|variable1value; variable2|variable2value"
The parts of the command line switch syntax are:
The path to the Author-it program.
The type, name and path of your Author-it Library. Author-it will open this library when found.
If not using trusted connections, you also need to pass the SQL parameters:
User account to sign into the Author-it Library database.
Password used to sign into the Author-it Library database.
Tells Author-it to publish documentation in the specified library using the book and output list.
The ObjectID of the book you want to publish in the library.
The ObjectID of the publishing profile you want to publish to.
Causes the publisher to return a "return code", as follows:
if publishing was successful
if an error or warning occurred 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. For example:
echo Starting Publisher - Book 825 to Publishing Profile 1077
"C:\Program Files\Author-it\Authorit.exe" /jet"C:\Program Files\Author-it\Data\Libraries\Acme.adl" /pub"825|1077" /returncode
If ERRORLEVEL 1 GOTO RET1
echo Publishing has worked
echo Publishing has failed
Note: The "return code" is automatically used, whether the parameter is added to the command line or not.
Tells Author-it to publish a specified variation of the the book. When multiple criteria are used, the variant information is separated with a semi colon. For example, /variant"Product|X2001;Country|USA"
Criteria label applied to the variant object. For example, "Product".
Specific value applied to the variant object. For example, X2001.
An example of a valid command prompt that runs Author-it, loads a specific JET library, publishes a book with the object code of 825 using the publishing profile with the object code of 1077 may look like: