Article View: adobe.scripting.indesign
Article #9471Re: [CS] Scripting XML Tag and Attribute application
From: Greg_Gaspard
Date: Mon, 21 Aug 2006 16:25
Date: Mon, 21 Aug 2006 16:25
25 lines
1768 bytes
1768 bytes
I'm delving into this and I'm having trouble with the syntax. Here's what I want to happen:
1. Select a range of text in InDesign CS. This text is encompassed within a block-level tag, but does not have a specific inline tag associated. (Easy enough, simply:
tell application "InDesign CS"
set myText to selection
)
2. Apply a specific tag to the selected text. In this case, I want to apply the tage name "span".
3. Apply a "class" attribute to the "span" tag
4. Apply a value of "anno" to the "class" attribute I just created.
How do I apply any XML tags, attributes or values to this text? In looking at the AppleScript dictionary for InDesign CS, there is a command in the XML Suite called "markup" that should help me with this, but I can't quite figure out how to get "markup" to apply the tag name, the attribute, or the attribute value. The syntax is listed as:
markup XML element �
using reference
When I try to apply "markup" to the selected range of text, I get the runtime error "{range of text} doesn't understand the markup message." Should this be done with a "set" command instead? What is the syntax?
Technical Details
Message-ID:
<3bc14ff6.0@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news2.volia.net!news.ecp.fr!news.stben.net!webcrossingReferences:
<3bc14ff6.-1@webcrossing.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,bc84c7fe0d57d424 X-Google-Attributes: gidf939a,public X-Google-Language: ENGLISH,ASCII From: Greg_Gaspard@adobeforums.com Newsgroups: adobe.scripting.indesign Subject: Re: [CS] Scripting XML Tag and Attribute application Message-ID: <3bc14ff6.0@webcrossing.la2eafNXanI> Date: Mon, 21 Aug 2006 09:25:07 -0700 References: <3bc14ff6.-1@webcrossing.la2eafNXanI> Lines: 28 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news2.volia.net!news.ecp.fr!news.stben.net!webcrossing