Upload
candace-meredith-miller
View
245
Download
3
Tags:
Embed Size (px)
Citation preview
DMED1100InDesign Advanced
Class 8
2
Agenda Scripting Introduction to XML
3
Scripting is Not … Overtly challenging Only for programmers Just for long tasks
4
Running Scripts Put the script in
Adobe InDesign CS4\Scripts\Scripts Panel Could also put a shortcut to the script in the
folder Open Scripts Panel
Window -> Automation -> Scripts Alt + Ctrl + F11
Double-click the script name
p. 683
5
Writing ScriptsThree main supported scripting languages: JavaScript
InDesign has built-in support called ExtendScript Is cross-platform Doesn’t easily communicate with other (Non-CS)
programs File extension .js or .jsx (preferred)
p. 683
6
Writing Scripts AppleScript
For the Mac OS File extension .applescript or .as
7
Writing Scripts Visual Basic
For Windows Three main types:
Visual Basic Script (VBScript) Visual Basic for Applications (VBA) Visual Basic (VB 6, VB.NET)
Textbook recommends using VBScript Can edit via text editor (NotePad or NotePad++)
Could also edit using VBA Accessible from most Office software
8
Writing Scripts In Excel
Developer -> Visual Basic If Developer tab is unavailable
Office Button -> Excel Options -> Popular -> Show Developer Tab in Ribbon
9
Writing Scripts Any language that can connect to the
platform works C, C++, C# Perl Python JScript And many others …
10
Scripting Tutorial Download
InDesignCS4ScriptingTutorial.pdf InDesignCS4ScriptingTutorialScripts.zip
Work through the tutorial
11
Using the ESTK Full-featured text editor Also checks syntax of script
Edit -> Check Syntax
Make sure InDesign selected as target application
To turn on ID’s screen display Scripts Panel (ID) -> Options -> Enable Redraw
p. 700
12
Monitoring Events Scripts can be run when events happen:
Opening a document Creating a new document Saving a document Closing a document Exporting
p. 710
13
Menu Scripts Scripts can run menu items or add items to
menus See Adobe InDesign CS4 Scripting Guide for
more details
p. 712
14
Startup Scripts Place script in a folder Startup Scripts in
Scripts folder Need to add some lines to prevent message
box
p. 712
15
XML Extensible Markup Language A way to tag information in a text file
<author>Information about author</author> Not just an extension of HTML
HTML is about formatting XML is about content
p. 739
16
XML Vocabulary Tag
A label for a piece of XML data Marked with angle brackets Cannot contain space characters Must be well formatted
XML Element The actual XML data
<author>Charles Dickens</author>
17
XML Vocabulary Elements may contain other elements:
<author><name>Charles Dickens</name><dob>7 February 1812</dob><birthplace>Landport, Portsmouth</birthplace>
</author>
18
XML Vocabulary XML Attribute
Use to add information about the element Known as Metadata
<author lastUpdate=“10/03/02”>
XML Comment Allow you to keep notes
<!-- This is a comment -->
19
XML Vocabulary XML Processing Instructions
InDesign does not use Can just delete if they exist
DTD (Document Type Definition) Description of:
What elements appear The order of appearance
Not required by InDesign
20
Structure View View -> Structure -> Show Structure
p. 743
21
XML Tags Tags panel
Window -> Tags
p. 749
22
Importing XML File -> Import XML Import Options:
Mode: Replace or Merge with existing XML Create Link: to source XML document Apply XSLT: apply a style sheet Clone Repeating Text Elements: allows automatic
placement of XML elements
p. 757
23
Replacing XML Elements Select structure in Structure View Choose Import XML Turn on Replace Content Turn on Import Into Selected Element
24
Exporting XML File -> Export Choose XML from Format pop-up menu
p. 762
25
Creating Placeholders Look at pp. 763-765