1. Trang chủ
  2. » Công Nghệ Thông Tin

Wile Adobe InDesign CS5 Bible phần 10 pps

93 276 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 93
Dung lượng 1,61 MB

Nội dung

Chapter 36: Working with XML 801 CustomerList branch that both contain tags named Name. You need to know which branch that text tagged Name should go into, because XML won’t know the context. Mapping tags and styles In the Tags panel’s flyout menu, you can also map style tags to XML tags and vice versa using the Map Tags to Styles menu option and the Map Styles to Tags menu option, respectively. (They’re also available in the Structure panel’s flyout menu.) Figure 36.2 shows the Map Styles to Tags dia- log box; the Map Tags to Styles dialog box is nearly identical, except the two columns are switched. Here’s what they do: FIGURE 36.2 The Map Styles to Tags dialog box l Map Tags to Styles tells InDesign what XML tag to substitute for a specified character or paragraph style during XML export. The text retains its original InDesign style tags. l Map Styles to Tags tells InDesign to immediately replace the specified styles with the XML tags. You see colored brackets around each string of text (paragraphs for paragraph styles and text selections for character styles) to indicate the text has an XML tag applied to it. The color corresponds to the tag color in the Tags panel. (You can change tag colors, as well as the tag name, using the Tag Options menu in the panel’s flyout menu or simply by double-clicking the tag name in the panel.) Note InDesign checks to make sure that you include valid XML tag names according to XML standards. If you include a space or an illegal character in the tag name, an alert message appears when you click OK. n 50_607169-ch36.indd 80150_607169-ch36.indd 801 4/22/10 8:09 PM4/22/10 8:09 PM Part IX: Programming InDesign 802 Applying Tags It’s easy to apply tags to text: Simply select the text and click the tag name in the Tags panel. If you want to replace the tag for selected text, be sure to select the Retag option in the Tags panel; other- wise, the original tag remains and the new tag is applied. Unless they’re style tags, multiple XML tags can be applied to the same object or text. If you choose View ➪ Structure ➪ View Tag Markers, tagged text displays brackets around it in the color of the tag in the Tags panel. Similarly, if you choose View ➪ Structure ➪ Show Tagged Frames, tagged frames and lines also show a color indicator. You can remove a tag by selecting the tagged text or object and then clicking the Untag button in the Tags panel. It gets slightly more complex if you’re using the Structure panel — which appears automatically to the left of the document window after you import XML data — to place tagged content imported from an XML file into InDesign objects. Figure 36.3 shows the Structure panel. (You show this panel by choosing View ➪ Structure ➪ Show Structure or pressing Option+Ô+1 or Ctrl+Alt+1. To hide it, use the same keyboard shortcuts or choose View ➪ Structure ➪ Hide Structure.) The panel shows the document’s tagged content as well as the tags associated with it. The content appears in a hierarchy, reflecting any nesting in the tags (similar to how a character style can be thought of as a subset of a paragraph tag, because it applies to a component of a paragraph). To apply XML content to a frame, simply click and drag the appropriate content (indicated with the Text Content icon) onto a frame. As you apply tags from the Tags panel to selected objects, you’ll see icons for text and objects appear along with the name of the applied tags. You can reorder the tags in the Structure panel to reflect the hierarchy of elements. Do this in coor- dination with your content engineer because the hierarchy in the InDesign file needs to match the hierarchy expectations in the XML database or content system. Taking Advantage of Other XML Options For the more XML-savvy, InDesign offers several controls in the Structure panel and its flyout menu, shown in Figure 36.3. In the panel, you have these options: l Validate Structure: This iconic button checks the current XML structure in the Structure pane and compares it against the DTD file imported with the XML data or imported later using the Import DTD option in the pane’s flyout menu. A copy of the Validate Structure iconic button is at the bottom of the pane, along with the View Errors List iconic button that shows any errors found. l Add an Attribute: This iconic button lets you add an XML attribute, which is essentially a comment such as the revision date. It has no effect on the flow of information or the appearance or role of an element. 50_607169-ch36.indd 80250_607169-ch36.indd 802 4/22/10 8:09 PM4/22/10 8:09 PM Chapter 36: Working with XML 803 l Add an Element: This iconic button lets you add an XML element, which is a tag applied to text or an object. l Remove Selected Elements: This iconic button removes any selected elements. FIGURE 36.3 At left: The Structure panel and its flyout menu. At right: The panel after validation, showing additional controls that appear if errors are found. Add an Attribute Validate Structure Add an Element Remove Selected Elements First Error Previous Error Current Error Last Error Next Error Validate Structure View Errors List 50_607169-ch36.indd 80350_607169-ch36.indd 803 4/22/10 8:09 PM4/22/10 8:09 PM Part IX: Programming InDesign 804 In the flyout menu, you have these options: l The New Element, New Parent Element, New Attribute, New Comment, and New Processing Instruction menu items let you add those items. l Delete deletes items. l Edit edits items. l Untag Element removes an element’s XML tag. l Go to Item lets you quickly move to the item with the selected tag. l Validate from Root Element verifies the structure starting at the root (topmost) object against the DTD information. l Validate from Selected Element starts the validation at the selected item. l View List of Errors shows a dialog box with any validation errors found. l Load DTD imports a document type declaration file, which defines the “role” of tags (such as indicating that the Head tag begins a section of a story). l Delete DTD removes the DTD file from the InDesign document but leaves the structure untouched. l DTD Options opens a dialog box in which you specify a specific element to validate the DTD from. l View DTD shows a dialog box with the actual DTD information (similar to a code preview in an HTML editor). l Import XML and Export XML duplicate the options in the File menu to import and export XML files. l The Hide Attributes, Hide Comments, and Hide Processing Instructions menu options remove these noncontent markers from view in the Structure pane so that you can con- centrate on just the elements. l Show/Hide Text Snippets shows or hides the first few words of text for each Text Content icon in the pane. Seeing these snippets is very helpful in knowing what each element actu- ally contains. l Add Untagged Items adds to the Structure pane all objects in the InDesign document that aren’t already tagged with an XML tag. This helps ensure that you don’t miss any object when reviewing the document structure. l The Map Tags to Styles and Map Styles to Tags menu options match InDesign styles to XML tags, as covered earlier in this chapter. l Tagging Preset Options lets you specify the default mapping of tags to specific kinds of content: text frames, tables, and table cells. By choosing tags for each of these, you can specify globally how specific types of tagged content are assigned within InDesign. 50_607169-ch36.indd 80450_607169-ch36.indd 804 4/22/10 8:09 PM4/22/10 8:09 PM Chapter 36: Working with XML 805 Exporting XML Files When the InDesign document has the proper elements properly tagged to the document’s content, you’re ready to export it to an XML file for use by a Web site’s content management system or other XML database. Choose File ➪ Export or press Ô+E or Ctrl+E to open the Export dialog box. In this dialog box, give the XML file a name in the Save As field (InDesign automatically adds the file name extension .xml), select a folder in which to place the file, and — most important — choose XML from the Format popup menu (on the Mac) or Save as Type popup menu (in Windows). Then click Save. The Export XML dialog box appears. It opens with the General pane. This pane is simple: l Include DTD Declaration: Select this check box to include the DTD information in the exported file. Otherwise, the XML database needs to import the DTD file separately. l View XML Using: Select this check box and select a Web browser or Web-supporting application in the adjacent popup menu to preview the XML file in that browser or program. l Export from Selected Element: If an element is selected in the Structure pane, the Export from Selected Element check box is available; if it’s selected, it exports the XML file only from that element on. l Export Untagged Tables as CALS XML: To convert InDesign tables not tagged with XML attributes to the CALS XML format, select this check box. l Remap Break, Whitespace, and Special Characters: To convert special characters to their XML codes, select this check box. l Apply XSLT: If this check box is selected, InDesign applies the XSLT style sheet either from the XML file or from a separate file; you specify which by using the popup menu to its right. l Encoding: Use this popup menu to choose the text encoding mechanism — a way of representing international characters across different computer systems. Your content engineer or Webmaster will tell you whether to select UTF-8, UTF-16, or Shift-JIS. In the Graphics pane, you tell InDesign how to handle the output of any tagged pictures. Your options are as follows: l Image Options section: Here, you indicate what images to copy to the Images subfolder that InDesign creates. Your choices are Original Images, Optimized Original Images, and Optimized Formatted Images. You can select any or all of these. The optimized images are converted to GIF or JPEG for use on the Web unless you specify GIF or JPEG in the Image Conversion popup menu rather than leave the default setting of Automatic; the formatted images crop the images to reduce file size. l GIF Options section: Here, you choose the color palette in the Palette popup menu, with choices of Adaptive (No Dither), Web, System (Mac), and System (Win). Ask your Webmaster what to use; usually, you select Adaptive (No Dither). For very large images, 50_607169-ch36.indd 80550_607169-ch36.indd 805 4/22/10 8:09 PM4/22/10 8:09 PM Part IX: Programming InDesign 806 interlacing can make on-screen display over the Web seem faster (by building the image line by line rather than waiting until the whole image has been transferred to the browser before anything appears); if you want to have such interlaced display of GIF files, select the Interlace option. l JPEG Options section: Here, you have options similar to those for GIF files. In the Image Quality popup menu, choose the desired image quality (Low, Medium, High, and Maximum). In the Format Method, choose Progressive to have the file displayed progres- sively (similar to the interlace option for GIF files) or Baseline to display it all at one time. Unless your images are very large, keep the default Baseline. When you export an XML file with graphics, InDesign automatically embeds XMP media manage- ment properties with the graphics’ tags. You can view those properties by choosing File ➪ File Info or pressing Option+Shift+Ô+I or Ctrl+Alt+Shift+I and then choosing the Advanced pane. This information may be of interest to your content engineer but has no real meaning for the page designer. However, the content engineer may want to fill out the information in the File Info dialog box’s other panes — Description and Origin — into which you can add comments, creator infor- mation and contact details, copyright information, credit and source information, keywords, and copyright URLs. Exporting to IDML Another way to export to XML format is by using the InDesign Markup Language (IDML) format. IDML is based on XML, so developers can work on InDesign layouts without needing InDesign. Note that IDML is not exactly XML, so only IDML-aware programs can use the IDML format; these are typically special apps or plug-ins to XML-aware apps meant to work specifically with InDesign files. For example, a company might add IDML capabilities to a catalog publishing system so that it can generate InDesign files directly from its catalog databases. Cross-Reference IDML is also the format used to save an InDesign CS5 layout in a format that InDesign CS4 can open, as Chapter 4 explains. n By using XML as the IDML file format’s basis, all of InDesign’s capabilities and content attributes are available to developers for, for example, layout automation, database publishing, and content management system applications. This supplements InDesign’s existing ability to expose all its internal XML capabilities via scripting, so other XML- and script-aware apps can work with InDesign directly. Note that none of this affects the designer using InDesign in terms of using InDesign itself. You export an InDesign layout to IDML format by choosing InDesign Markup (IDML) in the Format popup menu (on the Mac) or Save as Type popup menu (in Windows) in the Export dialog box (choose File ➪ Export or press Ô+E or Ctrl+E). There are no options; InDesign just creates the IDML file when you click Save. 50_607169-ch36.indd 80650_607169-ch36.indd 806 4/22/10 8:09 PM4/22/10 8:09 PM Chapter 36: Working with XML 807 Summary InDesign lets you tag content within documents with XML tags, so you can transfer that content to an XML database or Web content engine from which it can be used in a variety of media, format- ted as appropriate for each. You can also import XML content into InDesign, automatically placing content into the appropriate frames if you’ve created an appropriate template and tagged it with the right XML tags. But InDesign’s XML tools are only the beginning — you need an XML database and content-creation and content-presentation tools to use the XML data derived from InDesign documents. For organizations creating complex content creation and management workflows using XML, InDesign exposes all of its functionality as XML rules that can be scripted, essentially letting you flexibly control the creation of InDesign files based on XML programming and XML data attributes. It also has the new InDesign Markup Language (IDML) file format that is based on XML, so devel- opers can create and work with InDesign-compatible files in their own apps, using XML as the standard description for any elements they work with across apps. 50_607169-ch36.indd 80750_607169-ch36.indd 807 4/22/10 8:09 PM4/22/10 8:09 PM 50_607169-ch36.indd 80850_607169-ch36.indd 808 4/22/10 8:09 PM4/22/10 8:09 PM 809 CHAPTER Using Scripts IN THIS CHAPTER Installing and accessing scripts Exploring JavaScript Exploring AppleScript Exploring VBA Writing scripts Learning more about scripting S cripting automates many features in InDesign — it’s essentially a way to program InDesign to do specific actions. Because InDesign uses standard script languages, you can also run scripts that work with multiple programs in concert, including InDesign. (All the applications must support the same scripting language, of course.) For example, you might use scripts to automate database publishing, such as to run a database search, export data to a text file, import that file into InDesign, and then apply the appropriate formatting. InDesign supports three scripting languages: l JavaScript on both Mac and Windows l AppleScript on the Mac only l Visual Basic for Applications (VBA) on Windows only Because only JavaScript is supported by both platforms, I recommend you use it wherever possible so that your scripts can work in cross-platform envi- ronments. InDesign doesn’t force you to choose just one scripting language, so you could keep using old AppleScript or VBA scripts created for previous versions of InDesign, as well as new scripts written in JavaScript. As you become comfortable with scriptwriting, you’re also likely to discover that virtually everything you do with InDesign is a repetitive task. The more you can free yourself of this kind of work by using scripts, the more time you have to be creative. The possibilities are endless. But before you get too excited, remember that scripting is programming, so most layout artists stay clear of it, using scripts only if they have a programmer available to write them. 51_607169-ch37.indd 80951_607169-ch37.indd 809 4/22/10 8:09 PM4/22/10 8:09 PM Part IX: Programming InDesign 810 Using Scripts Accessing scripts is easy; they show up in the Scripts panel (choose Window ➪ Utilities ➪ Scripts or press Option+Ô+F11 or Ctrl+Alt+F11) if you’ve placed scripts in the Scripts folder inside the folder that contains the InDesign application, as shown in Figure 37.1. Scripts don’t have to be in the Scripts folder — they can be anywhere on your computer — but to use them outside this folder means you have to double-click them from your desktop rather than have access from within InDesign. FIGURE 37.1 The Scripts panel in InDesign and its flyout menu Script tips When writing scripts, you can associate a script to a specific InDesign menu action so that when a user chooses that menu item, a script runs automatically (technically, by assigning a script to a MenuAction command’s Prenotify or Postnotify property when writing the script’s code). In InDesign, be sure that Enable Attached Scripts is also enabled in the Scripts panel’s flyout menu. When running scripts, keep the following tips in mind: l You can undo all of a script’s action by using the InDesign Undo command (choose Edit ➪ Undo or press Ô+Z or Ctrl+Z) by ensuring that Undo Affects Entire Script is enabled in the Scripts panel’s flyout menu. Otherwise, the undo command reverses just the last action within the script, requiring you to undo several times to roll back the com- plete script action. l By enabling the Enable Redraw flyout menu option in the Scripts panel, you can force InDesign to redraw the display while a script is running. This ensures that any changes to the document are immediately visible. New Feature You can now access InDesign’s Tools panel and its tools via scripts in InDesign CS5. n 51_607169-ch37.indd 81051_607169-ch37.indd 810 4/22/10 8:09 PM4/22/10 8:09 PM [...]... about making the transition to InDesign CS5 IN THIS APPENDIX Understanding CS5 system requirements Installing InDesign CS5 Upgrading from prior versions of InDesign Removing InDesign Understanding InDesign CS5 System Requirements InDesign CS5 does not require extraordinary resources If you have a Mac or PC that runs one of the required operating systems, you can run InDesign CS5 Just be sure to have enough... need to save them so that InDesign knows they exist You have a choice of two locations: l The Scripts folder inside the InDesign application folder You can usually find it as Applications :Adobe InDesign CS5: Scripts in Mac OS X, and Program Files \Adobe\ InDesign CS5\ Scripts in Windows This makes the script available to all users of your computer If you want the script to start when InDesign launches, place... Feature InDesign CS5 has changed the sequence of installation steps to accommodate signing up for an Adobe ID, which lets you use Adobe s online services n Running the installation program Both the Mac OS X and Windows installers for InDesign CS5 provide easy-to-follow, on-screen instructions: 1 Be sure that all other Adobe programs are closed If you have other Adobe software installed, the InDesign. .. Users:username:Library:Preferences :Adobe InDesign: Version 7.0:en_US:Scripts:Scripts Panel l In Windows XP, the path is Documents and Settings\username\Application Data \Adobe\ InDesign\ Version 7.0\en_US\Scripts\Scripts Panel l In Windows Vista, the path is Users\username\AppData\Roaming \Adobe\ InDesign\ Version 7.0\en_US\Scripts\Scripts Panel l In Windows 7, the path is Users\username\AppData\Roaming \Adobe\ InDesign\ Version... script can use only one language) 825 Part X Appendixes IN THIS PART Appendix A Installing InDesign and Extensions Appendix B What’s New in InDesign CS5 APPENDIX Installing InDesign and Extensions I nstalling InDesign CS5 is surprisingly easy, but before installing or upgrading, make sure your system meets the InDesign CS5 system requirements Then use the steps in this appendix to make quick work of the... language that InDesign uses to English: Canadian so as not to have American spelling used in the spellchecker Chapter 19 explains how to set language dictionaries n 6 In the Enter an Adobe ID screen, enter your Adobe ID, which gives you access to Adobe s online services Having an Adobe ID also lets you access Adobe s free community-based tech support forums and track your Adobe licenses at Adobe s Web... fact that InDesign CS5 requires a new installation is that InDesign CS5 doesn’t have any of the custom settings you’ve selected in your earlier version of InDesign; you often don’t realize how many preferences you’ve set over time until you switch to a new version of the software If you did put some effort into customizing your previous version of InDesign, when you start using InDesign CS5, do the... (millions of colors) at a higher monitor resolution — InDesign s user interface barely fits in the 102 4-×-768 resolution typical of a 17-inch monitor l For PostScript printing, Adobe PostScript Language Level 2 or Adobe PostScript 3 Installing InDesign CS5 Before beginning the installation process, make sure that you have your serial number provided by Adobe and that you have an Internet connection so... for itself It might use InDesign CS5 or simply InDesign (yes, the name may include the registered trademark symbol) If you run a script from AppleScript (instead of just double-clicking it) and AppleScript can’t find InDesign, it gives you a dialog box with which you find the InDesign program When you’ve found and selected the InDesign application, AppleScript finds out what InDesign s file name is... complete, click Done Managing Extension Software InDesign lets you add plug-in software (now called extensions) to add new capabilities There are dozens of such extensions available from a variety of vendors; go to www.InDesignCentral com for a current list Note Plug-ins designed for earlier versions of InDesign do not work in InDesign CS5 n New Feature InDesign CS5 has significantly changed how extensions . access InDesign s Tools panel and its tools via scripts in InDesign CS5. n 51_607169-ch37.indd 8105 1_607169-ch37.indd 810 4/22 /10 8:09 PM4/22 /10 8:09 PM Chapter 37: Using Scripts 811 Script locations Whether. that InDesign knows they exist. You have a choice of two locations: l The Scripts folder inside the InDesign application folder. You can usually find it as Applications :Adobe InDesign CS5: Scripts. the format used to save an InDesign CS5 layout in a format that InDesign CS4 can open, as Chapter 4 explains. n By using XML as the IDML file format’s basis, all of InDesign s capabilities and

Ngày đăng: 08/08/2014, 20:22

TỪ KHÓA LIÊN QUAN