Automating WebMerge with Settings Files

WebMerge lets you save your settings to a file, and provides additional options for automating how WebMerge runs.

You can save your current WebMerge settings by choosing "Save Settings File" from the File menu. Saved settings files can be opened with the "Open Settings File" menu item. You can clear your current WebMerge settings with the "New Settings File" menu item.

The obvious advantage of saving your settings to a file is to save time next time you have to generate pages from the same source and templates.

But the real power of working with settings files is that they let you completely automate WebMerge: with the appropriate options selected in the Generation tab you can have WebMerge launch, generate your pages, upload them to your server, and quit, all by just double-clicking your settings file icon.

The automation options are described in detail in the Generation tab section, but they're worth calling your attention to them here to better understand how they can work together to streamline your workflow.

Setting the Auto-Run Options

The first step to automating WebMerge is to set this option in the Generation tab:

When checked, double-clicking a WebMerge settings file icon not only loads the settings but also runs WebMerge, generating pages from the templates and source file specified in the file.

This is not limited to double-clicking. Any normal means of launching an application with a given document on your operating system will work, including using VBS or batch files (Windows) or with AppleScript (Mac OS). This means that you can have other applications (such as your database program if it supports it) trigger WebMerge to run.

For example, you could create a script in FileMaker Pro that could sort and filter records, export them to a specified file, and run WebMerge to generate pages from that export file. Using your database's scripting in conjunction with WebMerge's Auto-Run option, you can automate most of your production workflow.

If you need to change any of the options in a settings file that has this option checked, just launch WebMerge first and then open the document by choosing "Open Settings File" from the File menu. Any WebMerge settings files opened from within the program this way will load the settings but will not run them until you click the "Build Pages" button.

Of course, if you launch an Auto-Run settings file, you may want WebMerge to quit when its done to free up system resources. To have WebMerge quit when it's done processing an automated settings file, just set this option:

By default, WebMerge displays a dialog window when its done building pages that shows the number of pages generated and the elapsed time. If you're automating WebMerge you probably don't want that dialog shown, since it requires you to click its OK button to dismiss it. You can prevent that dialog from appearing with this option:

Run Other WebMerge Files

WebMerge lets you run batches of settings files by adding those files to this list and setting this checkbox:

You can select other WebMerge settings files to add to this list by clicking the "Add Settings File.." button. To remove a file from this list, first select it and click "Remove File from Queue".

You can change the order in which these files are processed by using the "Move Up" and "Move Down" buttons on the right.

Note that any settings files included in this list must have their Auto-Run and Don't Show Results options set in order to avoid interrupting your batch run.

FTP Files to Server

Once WebMerge has finished generating your pages, you can have it upload those pages to your server by setting this checkbox:

The popup list to the right lets you select from the FTP servers you've entered. You can enter new server info or modify an existing set of info by choose "Edit list..." from this control. This opens the FTP Server Settings window which lets you create or delete FTP settings. Each FTP setting consists of a label (which appears in the popup list in the Generation tab), the host address or name (e.g., ", your user name and password for that host, and you can optionally specify the directory on that server that is the root of your Web site.

For expediency, WebMerge will only upload the files it generates. If you need to upload other files related to your site, consider using a dedicated FTP program.

Logging Results

WebMerge can optionally log results and errors to a log file for your reference by setting this checkbox:

If you have not already specified a log file, setting this option will trigger the "File..." button to let you specify where the results log will be written. You can also choose whether you want WebMerge to retain previous logs by appending the log file by choosing the "Append" option, or overwrite older logs by choosing "Overwrite".

Moving Settings Files To Other Computers

The file paths in WebMerge settings files are stored relative to the location of the settings file itself. This means that if you keep your WebMerge settings files in the same folder as your other Web-related files, you can move the folder that contains all of them to another location on your computer, or even another computer, and the settings file will still be able to locate the source files you've specified.

The file format of WebMerge settings files is the same for both Windows and Mac OS. So if you're working as part of a team with others with their own licensed copy of WebMerge, you can move files from machine to machine, even across platforms.