Adobe 65009333 Scripting Guide - Page 7

Getting Started, Installing scripts

Page 7 highlights

2 Getting Started Scripting is the most powerful feature in Adobe® InCopy® CS4. No other feature-no tool, panel, or dialog box you see in the program's user interface-can save you as much time, trouble, and money as scripting. This document is for every InCopy user. It does not matter if you never created a script before; this manual shows you how to get started. If you wrote scripts before for other applications, this manual shows you how to apply your knowledge to InCopy scripting. It covers installing and running an InCopy script, and it describes what InCopy scripting can and cannot do. It also discusses the software you need to get started writing your own scripts. Almost anything you can do with the InCopy user interface; you can do with a script. You can enter and format text, find and change text, add notes, and print or export the pages of the document. Any action that can change a document or its contents can be scripted. There are even a few things you can do in scripting that you cannot do using the user interface. Scripts can create menus, add menu items, create and display dialogs and panels, and respond to your user-interface selections. Scripts can read and write text files, parse XML data, and communicate with other applications. Scripts can do everything from very small tasks (like setting a tab stop at the location of the text cursor) to providing complete features. You can start with very simple scripts that do only one thing and move on to scripts that automate your entire publishing workflow. Most of the things scripting cannot do-like setting up a workspace or defining a set of keyboard shortcuts-are related to the user interface. In addition, scripts cannot add new kinds of objects to an InCopy document or add new, fundamental capabilities to the program, like a new text-composition engine. For that type of extensibility, you must to turn to the InCopy Software Development Kit (SDK), which shows you how to write compiled plug-ins using C++. This document talks about Adobe InDesign® as well as InCopy, because InCopy almost always is used in conjunction with InDesign documents. In addition, InDesign and InCopy scripting are very similar. For more on InDesign scripting, see Adobe InDesign CS4 Scripting Tutorial and Adobe InDesign CS4 Scripting Guide. Installing scripts To install an InCopy script, just put the script file in the Scripts Panel folder in the Scripts folder in your InCopy application folder. Alternately, put the script in the Scripts Panel folder in your user-preferences folder. You can find your user preferences folder at the following locations: Mac OS®: Users/user_name/Library/Preferences/Adobe InCopy/Version 6.0/Scripts Windows® XP: ~\Documents and Settings\user_name\Application Data\Adobe\InCopy\ Version 6.0\Scripts where user_name is your user name and ~ (tilde) is your system volume. Once the script is in the folder, it appears in the Scripts panel inside InCopy (choose Window > Scripts to display the panel). 7

  • 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

7
2
Getting Started
Scripting is the most powerful feature in Adobe® InCopy® CS4. No other feature—no tool, panel, or dialog
box you see in the program’s user interface—can save you as much time, trouble, and money as scripting.
This document is for every InCopy user. It does not matter if you never created a script before; this manual
shows you how to get started. If you wrote scripts before for other applications, this manual shows you
how to apply your knowledge to InCopy scripting. It covers installing and running an InCopy script, and it
describes what InCopy scripting can and cannot do. It also discusses the software you need to get started
writing your own scripts.
Almost anything you can do with the InCopy user interface; you can do with a script. You can enter and
format text, find and change text, add notes, and print or export the pages of the document. Any action
that can change a document or its contents can be scripted. There are even a few things you can do in
scripting that you cannot do using the user interface.
Scripts can create menus, add menu items, create and display dialogs and panels, and respond to your
user-interface selections. Scripts can read and write text files, parse XML data, and communicate with
other applications. Scripts can do everything from very small tasks (like setting a tab stop at the location of
the text cursor) to providing complete features. You can start with very simple scripts that do only one
thing and move on to scripts that automate your entire publishing workflow.
Most of the things scripting cannot do—like setting up a workspace or defining a set of keyboard
shortcuts—are related to the user interface. In addition, scripts cannot add new kinds of objects to an
InCopy document or add new, fundamental capabilities to the program, like a new text-composition
engine. For that type of extensibility, you must to turn to the InCopy Software Development Kit (SDK),
which shows you how to write compiled plug-ins using C++.
This document talks about Adobe InDesign® as well as InCopy, because InCopy almost always is used in
conjunction with InDesign documents. In addition, InDesign and InCopy scripting are very similar. For
more on InDesign scripting, see
Adobe InDesign CS4 Scripting Tutorial
and
Adobe InDesign CS4 Scripting
Guide
.
Installing scripts
To install an InCopy script, just put the script file in the Scripts Panel folder in the Scripts folder in your
InCopy application folder.
Alternately, put the script in the Scripts Panel folder in your user-preferences folder. You can find your user
preferences folder at the following locations:
Mac OS®:
Users/
user_name
/Library/Preferences/Adobe
InCopy/Version
6.0/Scripts
Windows® XP:
~\Documents
and
Settings\
user_name
\Application
Data\Adobe\InCopy\
Version
6.0\Scripts
where
user_name
is your user name and ~ (tilde) is your system volume.
Once the script is in the folder, it appears in the Scripts panel inside InCopy (choose Window > Scripts to
display the panel).