Building Output Using the Command Line

Use the following steps if you want to build a collection, standalone movie, or target from your operating system's command line. Using this method, you do not have to open Mimic at all.

Depending on the command(s) used, you can build a movie or collection and accomplish any of the following.

  • Build output using the default output format specified in Mimic.
  • Build output based on a target in your movie or collection.
  • Build output using a particular output format, overriding the default format specified in Mimic.

The best way to use the command line feature is to create a batch file with the necessary commands in it. Then you can use a scheduling tool (such as the Task Scheduler utility in Windows) to run the batch file automatically whenever you want.

How to Use the Command Line to Build a Collection, Movie or Target

  1. Open Notepad (to create and save a batch file) or open your command prompt (to run a command immediately).
  2. Type the path to the Mimic.app folder where you installed Mimic, and press ENTER.

    cd\Program Files\MadCap Software\MadCap Mimic 8.2\Mimic.app

    Note Alternatively, you can use cd c:\Program Files\[rest of the path] instead of cd\Program Files\[rest of the path].

  1. Type one of the following commands and press ENTER on your keyboard (entering the path/name of your collection, movie, target, output format, or variable file in place of the section in angle brackets).

    Tip Some operating systems allow you to drag a folder or file from the Windows location to the Command Prompt window. This will add the path of the folder or file within quotation marks for you.

    Note If there are spaces anywhere in the path/name of your collection, movie, output format, or variable file, you need to use quotation marks around it.

    To Build a Collection or Movie Using the Default Output Format

    Here is the command:

    console.mimiccompiler.exe -file [collection or movie]

    Example  

    If you have a Mimic collection called "My Big Collection" that you have stored in your Documents\My Mimic Movies folder, you would type this:

    console.mimiccompiler.exe -file "c:\documents and settings\myname\documents\my mimic movies\my big collection\my big collection.miprj"

    Example  

    If you have a Mimic movie called "My Little Movie" that you have stored in your Documents\My Mimic Movies folder, you would type this:

    console.mimiccompiler.exe -file "c:\documents and settings\myname\documents\my mimic movies\my little movie.mimovf\my little movie.mimov"

    To Build a Collection or Movie Using a Particular Target

    Here is the command:

    console.mimiccompiler.exe -file [collection or movie] -target [target name]

    Example  

    Let's say you have a Mimic collection called "My Big Collection" that you have stored in your Documents\My Mimic Movies folder. If that collection contains a target called "Demo," you would type this:

    console.mimiccompiler.exe -file "c:\documents and settings\myname\documents\my mimic movies\my big collection\my big collection.miprj" -target Demo

    Example  

    Let's say you have a Mimic movie called "My Little Movie" that you have stored in your Documents\My Mimic Movies folder. If that movie contains a target called "Practice Movie," you would type this:

    console.mimiccompiler.exe -file "c:\documents and settings\myname\documents\my mimic movies\my little movie.mimovf\my little movie.mimov" - target "Practice Movie"

    To Build a Collection or Movie Using a Particular Output Format, Overriding the Default Format

    Here are the possible commands:

    console.mimiccompiler.exe -file [collection or movie] -output-type html5

    console.mimiccompiler.exe -file [collection or movie] -output-type pdf

    Example  

    Let's say you have a Mimic collection called "My Big Collection" that you have stored in your Documents\My Mimic Movies folder. If the default output format for the collection is the PDF format, but you want to build output for the HTML5 format instead, you would type this:

    console.mimiccompiler.exe -file "c:\documents and settings\myname\documents\my mimic movies\my big collection\my big collection.mcmvf" -output-type html5

    Example  

    Let's say you have a Mimic movie called "My Little Movie" that you have stored in your Documents\My Mimic Movies folder. If the default output format for the movie is HTML5 but you want to build output for PDF instead, you would type this:

    console.mimiccompiler.exe -file "c:\documents and settings\myname\documents\my mimic movies\my little movie.mimovf\my little movie.mimov" -output-type pdf

    Now What?

    If you are using the command prompt window for any of the commands just described, the output generates immediately, and the files are copied to the Output subfolder for the collection or movie.

    If you are creating a batch file in Notepad, it might look something like this:

Batch Files and Task Scheduler

If you are creating a batch file, save the Notepad file to any location you like on your computer. When you do this, type .bat as the extension at the end of the file name (e.g., MyBatchFile.bat). At any time you like, you can generate the output simply by double-clicking the batch file. You can also use a tool to schedule the batch file to run.

For example, complete the following steps if using the Windows 10 Task Scheduler utility.

  1. In the Windows search field, type Task Scheduler and press ENTER.
  2. Click Action > Create Basic Task.
  3. In the Create Basic Task Wizard, give the task a name and click Next.
  4. Using the next couple of pages of the wizard, choose when you wan the batch to run (e.g., daily, starting at 2 a.m.). Click Next until you get to the Action page.
  5. Click Start a program, and click Next.
  6. Click Browse. Then find and double-click the batch file you created.
  7. Click Next.
  8. Click Finish.

What’s Noteworthy?

Warning If your computer's anti-virus (AV) software scans the Output folder during the build process and you experience one or more "Build Failed" errors, the AV software may be preventing the build process from accessing the output files. To avoid this, you can temporarily turn off or disable your AV scan. You may also be able to exclude the Output folder, add Mimic to an exceptions list, or postpone/reschedule scans to a different time. See your AV vendor for information.

Note By default, if you use the command line feature to generate movie output, the movie is compiled the first time you run the command. If you do not make any changes to the movie and attempt to run the command again, the movie is not generated. However, you can force the movie to be recompiled in situations such as this. To do this, you can add the following flag at the end of your command:

-recompile

What's Next?

After you build your final output, you can then move on to the final step, Distributing Output.