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.
Note: To publish from the command line, you must enable local user plug-ins.
Enable local user plug-ins
- In Author-it Administrator, go to Settings > Plug-in Settings.
- Select Enable local user plug-ins.
- Select a Plug-in folder.
Note: If you don't normally use plug-ins, you can select any folder, including an empty one.
Publish from the command line
- From Publishing console, select the profile and books you want to publish.
- Click the Show Command Line button
-or-
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.
Syntax examples
- 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:
Argument | Description | |
Authorit | The path to the Author-it program. | |
libraryname | The type, name and path of your Author-it Library. Author-it will open this library when found. For example: /jet"C:\Program Files\Author-it\Data\Libraries\Acme.adl" -or- /sql"Acme|server1|True" | |
If not using trusted connections, you also need to pass the SQL parameters: /sql"Acme|server1|False|login id|password" | ||
/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. | |
profile | The ObjectID of the publishing profile you want to publish to. | |
/returncode | Causes the publisher to return a "return code", as follows: | |
0 | if publishing was successful | |
1 | 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: PUBLISH.BAT @echo off 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 GOTO END :RET1 echo Publishing has failed :END Note: The "return code" is automatically used, whether the parameter is added to the command line or not. | ||
/variant | 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" | |
variant name | Criteria label applied to the variant object. For example, "Product". | |
variant value | Specific value applied to the variant object. For example, X2001. |
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 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:
"C:\Program Files\Author-it\Authorit.exe"/jet"C:\Program
Files\Author-it\Data\Libraries\Acme.adl" /pub"825|1077"