7.6

Table Of Contents
-1 Script file does not exist or is not accessible.
-2 Invalid script language.
-3 Error during script execution.
Use of PlanetPress APIs within called scripts
When a script is called from within PlanetPress Design using ExecScriptFile(), all of the PlanetPress environment is available to
the script, including the Watch, Metadata, Capture and Alambic objects.
Using these objects from a script within a Design document is not supported and can lead to unexpected results. Fur-
thermore, setting a Watch variable or job info from within the script will not return this value to the document, as
these values are always passed once when the document is called, never during execution.
Accessing Parameters from the script
The parameters value is a string which is sent to the executed script. It is available using the Script.Paramstring system var-
iable from within the code. If you want to send multiple parameters, you will have to separate them with a special character
and use this character as a separator to split the string or create an array with it, such as (example in JavaScript):
params = Script.Paramstring.split(";")
Code Example
ExecScriptFile('c:\myScript.vbs', 'name;'+@(1,1,10), 1)
Sample Scripts
2 sample scripts are available with any PlanetPress Suite installation.
They are are located in C:\Documents and Settings\All Users\Application Data\Objectif Lune\PlanetPress Suite N\Scripts,
where N is the PlanetPress Suite version number. These 2 sample scripts are used by PlanetPress Design's Excel Graph func-
tionality, allowing to insert a business graphic from a Microsoft Excel file.
Exit (procedure)
Exits from a for...endfor or repeat...until loop.
Syntax
exit()
Argument
None
Code Sample Example
This example shows how to break from a loop when a specific word, in this case ’Invoice,’ is found somewhere on the data
page.
define(&x,integer,1)
for(&x,1,1,&current.lpp)
if(pos('Invoice',@(&x,1,80))>0)
exit()
©2010 Objectif Lune Inc - 274 -