Corel Ventura Automation

One of Corel Ventura’s major strengths is that it can be automated to a great extent. That means that many tasks that can be done manually by pointing, clicking, dragging, deciding, etc., can be done by a script or Add-on. Tasks that would have taken hundreds or even hundreds of thousands of clicks and hours of drudgery to accomplish, as well as tasks that would be practically impossible to perform manually, can be handled by an appropriate automation solution.

Whether you need to prepare a complex index with thousands of entries for a standardized publication, align the column baselines of a multi-column catalog, or import, place, and resize 1000 catalog images, we can help you to reduce your processing time from hours or days to minutes or even seconds. [Read about a simple script in action.]

If you’ve got a project that you think might benefit from an automated solution, please contact us with the details of your project. We’ll be happy to discuss it with you. We also offer automation training solutions to teach you how to automate Ventura yourself. Our courses are custom-designed with your project as the training base so that you learn through doing for lasting results.

Free Scripts

We’ve got a number of free scripts posted below, all developed to make our own work easier or in response to a request in the Corel Ventura newsgroups. Be sure to read the notes inside each script for known issues before you use them. And do please drop us a note if you find any of them useful. Please note that many of these scripts are early examples of my code; I’d do a number of things quite differently now, but haven't yet found time to update these.

Help writing your own scripts can be found here.

Insert URL Hyperlink (V10.397)

Purpose: A bug in Ventura 10 results in a crash when you insert a hyperlink directly after a line break. This basic script works around this by inserting a space before inserting the hyperlink. It then deletes the inserted space.
tabspaceIt's a very basic script in the present version. As always, feel free to contact us if you need something more suited to your needs.

Usage: Select a URL, then run this script.

Version: 1.00

Date: March 23, 2005

Download (1.07K): For Ventura 10

Size (Shrink) All Frames to Object

Purpose: After generating frames with Database Publisher, frames are not sized to the size of their pictures. When you have a bunch of different-sized pictures, this can mean a lot of manual frame sizing. This script resizes all frames to the end of the current chapter (or publication, if you modify the script slightly) to the size of their contents--equivalent to right-clicking each frame in Ventura and choosing Picture, Size Frame to Picture.
tabspaceThis version expects that frames will shrink to their contents, NOT expand. This means that it will process all frames on a page, even if additional frames are pulled up from a following page due to frames shrinking. Do not expect it to work correctly when frames grow and are bumped to the next page (not tested). It also does not discriminate between frame tags: all drawn frames are resized. As always, feel free to contact us if you need something more suited to your needs.

Usage: Select a starting page, then run this script.

Version: 1.00

Date: March 10, 2005

Download (2.04K): For Ventura 10 | For Ventura 8

Snap Frame Height to Interline Multiple

Purpose: To correct the height of a frame resized by dragging with Interline Snap turned on. It will resize any frame to the nearest exact multiple of the chapter’s “Interline snap” setting. If the bottom of the frame is snapped to the bottom margin, the script will keep it there when resizing.
tabspaceA bug in Ventura 8.559 and 10.397 results in frame height being inaccurately set when dragging to resize frames with interline snap turned on. For example, with a frame snapped to the bottom margin and the interline snap value set to 12.00 pt (in Chapter Properties), resizing the frame to what should be 48.00 pt high may result in a frame that's 48.01 pt high; with an 11.00 interline snap value, instead of 44.00 pt you might end up with 43.99 pt. This results in misfitting lines and a headache to resize/reposition manually. Additionally, because Ventura uses tenths of a micron internally (“Ventura units”), the size variance may be too minute to be displayed in dialogs.
tabspaceThis script makes it easy to correct the problem.

Usage: Select a frame, then run this script.

Version: 1.00

Date: March 5, 2004

Download (2.04K): For Ventura 10 | For Ventura 8

Snap Frame Bottom to Bottom Margin

Purpose: Snaps the bottom of a frame to the bottom margin.

Usage: Select a frame, then run this script.

Version: 1.00

Date: March 5, 2004

Download (1.0K): For Ventura 10 | For Ventura 8

Center Frame Horizontally

Purpose: Centers a frame between the left and right margins of a page. Frame captions are taken into account.

Usage: Select a frame, then run this script.

Version: 1.1

Date: April 29, 2004

Download (1.34K): For Ventura 10 | For Ventura 8

Center Frame Vertically

Purpose: Centers a frame between the top and bottom margins of a page. Frame captions are taken into account.

Usage: Select a frame, then run this script.

Version: 1.1

Date: April 29, 2004

Download (1.34K): For Ventura 10 | For Ventura 8

Insert Linked Frames

Purpose: To create frames linked to the starting frame throughout a chapter, one per page, through which a single text file will flow. Useful for manual placement of footnotes. This script prompts the user for the number of linked frames to create, and is intelligent enough to create frames all the way to the end of a chapter automatically, and to create frames mid-series to replace deleted frames without exceeding the number of missing frames.

Usage: Create the first frame and tag it with your frame tag of choice. Place your text file, then select the frame and run the script. If you create a frame tag that includes size and position info (uncheck “omit from tag” on the frame properties Placement tab), you can create a frame in the same position on each page. This is what we’ve done for footnote frames, which can then be resized as necessary. For pages with no footnotes, simply delete the frame created on that page.

Date: August 11, 2002

Download (3.0K): For Ventura 10 | For Ventura 8

Delete Linked Frames

Purpose: To delete a series of linked frames, beginning with the currently selected frame and continuing to the end of the series. This script is extremely basic, but serves my current needs.

Usage: Select the first linked frame you want to delete (can be any frame in the linked series), then run this script.

Date: August 11, 2002

Download (1.1K): For Ventura 10 | For Ventura 8

Bookmark Page

Purpose: To bookmark a page for quick return.

Usage: This package is comprised of two scripts. “” stores the current page in a publication variable. “Current page” means any page:
tabspace• that is selected;
tabspace• on which an object is selected; or
tabspace• on which your cursor is planted in text.
“” jumps to the page stored by the first script. Assign shortcuts to both for ease of use.

Version: 1.02

Date added/updated: October 15, 2003/March 4, 2004

Download (1.9K): For Ventura 10 | For Ventura 8

Line Information

Purpose: A basic script to display information about the position of a line of text relative to the page margins.

Usage: Plant the cursor, then run this script.

Version: 1.02

Date: October 14, 2003

Download (1.65K): For Ventura 10 | For Ventura 8

Embed All Text Files

Purpose: The name says it all. This script is a complement to Corel’s “EnableExportOnSave” script, though much simpler. Because this script uses a command new to Ventura 10, it is V10-only.

Usage: Open a publication, then run this script. You will be prompted with a dialog before all text files are embedded, at which point you can choose to cancel the operation.

Date: November 17, 2002

Download (1.2K): For Ventura 10

Insert Absolute Page Numbers

Purpose: This script looks for every occurrence of two markers and inserts the absolute page number (the Page Number of the Go To Page dialog) wherever they appear. The markers it looks for are “AbsPNBeg” and “AbsPNEnd”. If it finds any characters (such as a pre-existing page number) or non-marker items between these two markers it will remove them before inserting the page number. Do not put anything, including formatting attributes and other items, between these two markers!

Usage: Insert the markers “AbsPNBeg” and “AbsPNEnd” wherever you want to display the absolute page number. Put them on your page tags if you want them on every page. You can use my supporting “InsertAbsPNMarkers” script (included in this release) to insert both markers with one click/shortcut. Then run this script. Note: It runs fastest if you set the view to 1:1 and the zoom to full page in Page Layout view.

Date: September 10, 2002

Download (1.6K): For Ventura 10 | For Ventura 8

Reset Broken Undo (a workaround for Ventura 10.397)

Purpose: To work around a bug in Ventura 10.397 (the initial release). Under certain circumstances, particularly after importing text to and saving a publication, Undo becomes ineffective for subsequent text edits. You can hit Undo, but while the edit is removed from the Undo list, your changes to the text are not undone.
tabspaceThis simple script saves, closes, and reopens the current publication, which resets the Undo function so that it works again. The script returns you to the page you were on (in Page Layout view) when you started.

Usage: After you import text, just run this script. We have assigned it to a toolbar button for ease of use.

Date: November 3, 2002

Download (0.7K): For Ventura 10

Fix Hyphenation Bug (a workaround for Ventura 10.397)

Purpose: A bug in Ventura’s hyphenation engine results in many words NOT being hyphenated automatically. This can happen anywhere in a paragraph, but we see it most frequently in the first word of the last line. Some have found that resetting hyphenation on affected paragraph tags corrects the issue for embedded (internal) text. Our workflow often calls for external text, and merely resetting the hyphenation corrects the problem only for the duration of the session; as soon as the text is reloaded after closing and reopening the file, the problem is back.
tabspaceThe fix we’ve found to be reliable is to insert a discretionary hyphen at the point where hyphenation should occur. Our script prompts Ventura to reexamine a paragraph for appropriate hyphenation points by deleting/reinserting a space at the start of the current line, then, if hyphenation occurred, inserts a discretionary hyphen at the hyphenation point.

Usage: Plant the cursor anywhere in a line whose first word is not hyphenating when it should, then run this script. We’ve got it attached to CTRL-z here.

Date: December 19, 2002

Download (0.9K): For Ventura 10

Test for Lost General Publication Settings

Purpose: A bug in V8.559 and V10.397 occasionally causes the break characters and other settings, including the “Print Blank Pages” setting, to be lost when you change Publication Properties. We haven’t yet figured out what’s at the root of this phenomenon. This script tests the “Print Blank Pages” setting (there are no scripting commands available to test the break characters): if set to anything other than “Never Insert”, it will alert you to the potential loss of critical break character settings.

Usage: Just run the script on any open pub to return a message.

Date: November 17, 2002

Download (1.0K): For Ventura 10 | For Ventura 8

Get a File’s Pathname (Function)

Purpose: To return the pathname of the current text file.

Usage: Plant the cursor in a text file, then run this script to return a message containing the pathname. OR, extract the function into another script and use it as needed.
tabspaceSince the function is most useful when embedded in another script, we haven’t posted a V8-specific version.

Date: April 11, 2003

Download (0.7K): For Ventura 10

Display Elapsed Time

Purpose: To display the time elapsed during script operations.

Usage: This script is not for standalone use. See the comments interspersed within the code for details of how it works, and incorporate its parts into your existing scripts as needed.

Version: 1.01

Date: October 12, 2003

Download (1.0K): For all versions

Script Navigation Center for Script Editor 8

Purpose: This collection of three scripts is designed to make it easier to move around complex scripts during creation and editing.

Usage: Run on an open script (we’ve assigned it to ALT-N) and it will automatically build an alphabetical list of all subroutines and functions. Double-click an entry and you’ll be taken to the line on which the item begins. Single-click an entry and its parameters, if any, will be displayed below the list. Click the Bookmark Line button and the current line will be saved to an ini file. Click Goto Bookmark and you’ll jump to the saved line. and are standalone scripts that perform the same functions as the buttons of the same name in SE_NavCenter. We have them on Alt-B and ALT-G, respectively.
tabspacePut all three scripts in the Graphics8\scripts folder. See the notes at the beginning of each script for known issues and further details.

Version: 1.03

Date: May 4, 2003

Download (6.8K): For Script Editor 8