Adobe 65009333 Scripting Guide - Page 19

Scripting Features, Script preferences

Page 19 highlights

3 Scripting Features This chapter covers scripting techniques that relate to InCopy's scripting environment. Almost every other object in the InCopy scripting model controls a feature that can change a document or the application defaults. By contrast, the features in this chapter control how scripts operate. This document discusses the following: ➤ The scriptPreferences object and its properties. ➤ Getting a reference to the executing script. ➤ Running scripts in prior versions of the scripting object model. ➤ Using the doScript method to run scripts. ➤ Running scripts at InCopy start-up. ➤ Controlling the ExtendScript engine in which scripts execute. We assume you already read Chapter 2, "Getting Started" and know how to write, install, and run InCopy scripts in the scripting language of your choice. Script preferences The scriptPreferences object provides objects and properties related to the way InCopy runs scripts. The following table provides more detail on each property of the scriptPreferences object: Property EnableRedraw scriptsFolder scriptsList Description Turns screen redraw on or off while a script is running from the Scripts panel. The path to the scripts folder. A list of the available scripts. This property is an array of arrays, in the following form: [[fileName, filePath], ...] Where fileName is the name of the script file and filePath is the full path to the script. You can use this feature to check for the existence of a script in the installed set of scripts. 19

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88

19
3
Scripting Features
This chapter covers scripting techniques that relate to InCopy’s scripting environment. Almost every other
object in the InCopy scripting model controls a feature that can change a document or the application
defaults. By contrast, the features in this chapter control how scripts operate.
This document discusses the following:
The
scriptPreferences
object and its properties.
Getting a reference to the executing script.
Running scripts in prior versions of the scripting object model.
Using the
doScript
method to run scripts.
Running scripts at InCopy start-up.
Controlling the ExtendScript engine in which scripts execute.
We assume you already read
Chapter 2, “
Getting Started
and know how to write, install, and run InCopy
scripts in the scripting language of your choice.
Script preferences
The
scriptPreferences
object provides objects and properties related to the way InCopy runs scripts.
The following table provides more detail on each property of the scriptPreferences object:
Property
Description
EnableRedraw
Turns screen redraw on or off while a script is running from the Scripts
panel.
scriptsFolder
The path to the scripts folder.
scriptsList
A list of the available scripts. This property is an array of arrays, in the
following form:
[[
fileName
,
filePath
], …]
Where
fileName
is the name of the script file and
filePath
is the full path
to the script. You can use this feature to check for the existence of a script
in the installed set of scripts.