Recording and saving a script

You can create a scripts by recording the commands that you want to automate. Whenever, you want to repeat the operations you would run the script.

To record and save a script

1 Click Tools, Corel SCRIPT, Script And Preset Manager.

2 Click the Record button.

3 Perform the procedures you want to record.

4 Click the Stop button.

5 Type a name for your script in the Name box. a script

After you create a script you can run it in the Drawing Window. You can run scripts from the Script and Preset Manager or from the Run Script command. When you run a script, the operations that you recorded are performed automatically.

Running

To run a script from the Script Manager

1 Click Tools, Corel SCRIPT, Script And Preset Manager.

2 Choose a script from the Script Manager. ► 3 Click the Play button.

To run a preset script from the Script Manager

1 Click Tools, Corel SCRIPT, Script And Preset Manager.

2 Open the Scripts, Presets folder, then choose a script.

3 Click the Play button.

To run a script

1 Click Tools, Corel SCRIPT, Run.

2 Select the folder and filename of the script you want to run.

3 Click Open.

• If you often run the same script, you can assign it to a shortcut key, a toolbar button, or a menu.

^ • You can also run scripts by opening Corel Script Editor. You can open Corel SCRIPT Editor from the Windows desktop or by clicking Tools, Corel SCRIPT, Corel Script Editor.

Using Corel SCRIPT Editor

The Corel SCRIPT Editor, included the CorelDRAW, is a tool that you can use to modify your saved recordings or scripts. For example, if you have a script that you want to make a change to, you can use the Corel SCRIPT Editor to edit the commands in the script. It's often easier just to modify a few commands rather than to rerecord the entire script. As well as editing commands, you can use Corel SCRIPT Editor to add commands that can't be recorded or to write scripts from scratch.

Since scripts are standard text files, they can be edited with any Windows text editor or word processor. However, Corel SCRIPT Editor also includes features to test, debug, and run script files. Corel SCRIPT scripts can be saved as text only or as standalone executables. Text files do not contain a compiled binary component and are compiled each time the script is executed. Standalone executables contain binary code that you cannot edit in a text editor. Corel SCRIPT files are saved with the extension .CSC.

Corel SCRIPT Editor also includes tools to quickly create and edit custom dialog boxes that let users return input to a running script. For more information see, "Using custom dialog boxes in scripts" on page 824.

Corel SCRIPT Editor programming language

Any scripts you save contain CorelDRAW commands. These commands are part of the Corel SCRIPT programming language. The Corel SCRIPT programming language consists of application commands and functions as well as programming statements and functions. When using the Corel SCRIPT programming language there are commands you use frequently that use parameters such as measurements and coordinates. You can also use OLE automation to access other application components. CorelDRAW also provides a utility that will convert your version 7 and 8 script to version 9.

Computer programming experience isn't a prerequisite for using Corel SCRIPT to modify and write scripts. However, the more knowledge, experience, and desire you have to learn the mechanics of CorelDRAW, the more you'll be able to take advantage of the power of Corel SCRIPT. The amount of information you need to know about scripting depends on the complexity of your scripts. The Corel SCRIPT online Help file contains instructions for novice script writers as well as reference material for experienced script writers and programmers.

Was this article helpful?

0 0

Post a comment