Getting The Current Script - Adobe 65009333 - InCopy CS4 - PC Manual

Scripting guide: javascript
Hide thumbs Also See for 65009333 - InCopy CS4 - PC:
Table of Contents

Advertisement

Scripting Features
Property
userInteractionLevel
version

Getting the current script

You can get a reference to the current script using the
You can use this property to help you locate files and folders relative to the script, as shown in the
following example (from the ActiveScript tutorial script):
var myScript = app.activeScript;
alert("The current script is: " + myScript);
var myParentFolder = File(myScript).parent;
alert("The folder containing the active script is: " + myParentFolder);
When you debug scripts using a script editor, the
from the Scripts palette appear in the
When you debug scripts from the ExtendScript Toolkit, using the
To avoid this error and create a way of debugging scripts that use the
following error handler (from the GetScriptPath tutorial script):
function myGetScriptPath() {
try{
return app.activeScript;
}
catch(myError){
return File(myError.fileName);
}
}
Description
This property controls the alerts and dialogs InCopy presents to the user.
When you set this property to
InCopy does not display any alerts or dialogs; set it to
UserInteractionLevels.interactWithAlerts
disable dialogs; and set it to
display of alerts and dialogs. The ability to turn off alert displays is very
useful when you are opening documents via script; often, InCopy displays
an alert for missing fonts or linked graphics files. To avoid this alert, set the
user-interaction level to
before opening the document, then restore user interaction (set the
property to
interactWithAll
The version of the scripting environment in use. For more information, see
"Script versioning" on page
the version of the application.
activeScript
activeScript
UserInteractionLevels.neverInteract
interactWithAll
UserInteractionLevels.neverInteract
) before completing script execution.
21. Note that this property is not the same as
property of the application object.
activeScript
property returns an error. Only scripts run
property.
activeScript
activeScript
Getting the current script 20
to enable alerts but
to restore the normal
property returns an error.
property, use the
,

Advertisement

Table of Contents
loading

This manual is also suitable for:

Incopy cs4

Table of Contents