EDOBE XDOM TPC Technical Information Page 34

  • Download
  • Add to my manuals
  • Print
  • Page
    / 68
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 33
34
4
Scripting with AppleScript
This chapter uses script examples and explanations to help you to become familiar with Illustrator
scripting using AppleScript.
For more information
Several extended sample scripts are in the :Scripting:Sample Scripts folder in your Illustrator CS5
installation directory.
For information about individual classes, objects, properties, commands, and parameters, as well as script
samples that demonstrate how to use many of these items, see Adobe Illustrator CS5 Scripting Reference:
AppleScript, in the
:Scripting:Documentation folder in your Illustrator CS5 installation directory. You
also can view the Illustrator CS5 dictionary from the Script Editor application;see
Viewing the AppleScript
object model” on page 9.
If you do not understand the concepts and terms used in this chapter, read Adobe Introduction to Scripting.
Your first Illustrator script
The traditional first project in any programming language is displaying the message “Hello World!” In this
example, you create a new Illustrator document, then add a text frame containing this message. Follow
these steps:
1. Open Script Editor.
In a default Mac OS installation, Script Editor is in
Applications:AppleScript:Script Editor. If you
cannot find the Script Editor application, you must reinstall it from your Mac OS system CD.
2. Enter the following script.
--Send the following commands to Illustrator
tell application "Adobe Illustrator"
--Create a new document
set docRef to make new document
--Create a new text frame with the string "Hello World"
set textRef to make new text frame in docRef ?
with properties {contents: "Hello World!", position:{200, 200}}
end tell
3. In the Script Editor toolbar, click Run.
T
IP: To add the script to the Illustrator Scripts menu (File > Scripts), save the script in the Scripts folder. The
script will appear on the menu the next time you start Illustrator. For details, see
Installing scripts in the
Scripts menu” on page 10.
Page view 33
1 2 ... 29 30 31 32 33 34 35 36 37 38 39 ... 67 68

Comments to this Manuals

No comments