Thread View: adobe.scripting.indesign
2 messages
2 total messages
Started by SuperMacGuy
Tue, 17 Feb 2009 20:46
[CS3 AS] Tagging text (xml)
Author: SuperMacGuy
Date: Tue, 17 Feb 2009 20:46
Date: Tue, 17 Feb 2009 20:46
30 lines
1907 bytes
1907 bytes
Does anyone have any tricks to tag some text objects? I don't fully understand all the intricacies of xml items. I need to apply a tag to a text string in several text frames. The text is already there, and I want to tag it as an xml item, for exporting later. I can make the tag before hand, in fact I'd like to make the tag before hand, and be able to use the same tag on several objects.
So for example we have a date "2-14-09" and want to tag it as "theDate". I've looked and XML suite and I'm seeing a "markup" command. If I have a tag "theDate" how would I apply that to some text in a frame?
If I do it manually I can select some text, and select the tag from the pallet, and it puts a default "Story" object inside root.
Thanks,
Chris
Here's a script I'm trying without success:
tell application "Adobe InDesign CS3"
tell document 1
set myRootXMLElement to XML element 1
set myXMLTag to (get XML tag "theDate")
set myXMLStoryTag to (get XML tag "Story")
tell myRootXMLElement
set theStoryElement to make XML element with properties {markup tag:myXMLStoryTag}
tell theStoryElement
set myXMLElement to make XML element with properties {markup tag:myXMLTag}
end tell
end tell
tell text frame 1
tell word 2
markup using myXMLElement
end tell
end tell
end tell
end tell
Re: [CS3 AS] Tagging text (xml)
Author: SuperMacGuy
Date: Fri, 20 Feb 2009 18:35
Date: Fri, 20 Feb 2009 18:35
2 lines
768 bytes
768 bytes
Please help. Hasn't anyone ever tried this or had any success? I can tag a story but I can't get down to tagging a particular word in a story.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads