Using the object model of the corresponding application, JS scripts can help you manipulate documents, layers, objects, effects, and more. However, unlike VBA and VSTA, you cannot use JavaScript in CorelDRAW Graphics Suite and CorelDRAW Technical Suite to create tools and add new UI items such as toolbars and dialog boxes.
You can record and load JS scripts. When you record a JavaScript script, all information is provided by the host application — CorelDRAW or Corel DESIGNER. In Corel PHOTO-PAINT, actions can be recorded as Corel SCRIPT scripts but not as JS scripts. For more information, see Corel scripts in the Corel PHOTO-PAINT Help.
Similarly to VBA and VSTA, you can use JavaScript to record temporary scripts for actions that you need to repeat only a few times. A temporary script is accessible until a new temporary script is recorded.
You can perform the actions that are associated with a script by playing that script. If you need to edit the script, you must use Notepad or another text editor instead. The applications don't provide a dedicated JavaScript editor.
You can rename and delete scripts.
The following notes can help you get started with JS scripts:
host.ActiveDocument
host.ActiveView
alert
Foo(x, , z)
Foo(x, undefined, z)
Example: someObject.somePropertyName(someInputParameter)
someObject.somePropertyName(someInputParameter)
ClassName
For details on using JS scripts, see the following procedures:
Note the following: