[Indesign CS/XML] Find/Replace via tags
[Indesign CS/XML] Find/Replace via tags
- Subject: [Indesign CS/XML] Find/Replace via tags
- From: Philip Regan <email@hidden>
- Date: Tue, 3 Jan 2006 18:47:39 -0500
UPDATE:
So I cooked up this script to try and explain better what it is that
I'm trying to do. Thsi is far as I can get now without coming across
errors:
[code]
property theList : {}
tell application "InDesign CS"
set thePara to object reference of selection --gets the insertion point
set thePrnt to parent of thePara --gets the text flow
set paraCount to (get count of paragraphs in thePrnt) --count the paragraphs
repeat with p from 1 to paraCount --get the properties, and then the
applied XML tag
set paraProp to properties of paragraph p of thePrnt
set paraXML to associated XML elements of paraProp
set end of theList to paraXML
end repeat
return theList
end tell
[/code]
As expected, the script returns this:
{{XML element id 2 of XML item id 1 of document
"IC2K6_template_0_1_2.indd" of application "InDesign CS"}, {XML
element id 413 of XML element id 2 of XML item id 1 of document
"IC2K6_template_0_1_2.indd" of application "InDesign CS"}, {XML
element id 413 of XML element id 2 of XML item id 1 of document
"IC2K6_template_0_1_2.indd" of application "InDesign CS"},...[snip]}
My idea is to use these paths, because that's all there is to work
with, to get the name of the tag to see if it's the one I want. But
the problem is that these paths...
--can't be used to make an object reference
--can't be used to get properties
--and can't even be converted into a simple string
and that's all ANY page item gives to reference the tags. Maybe I'm
looking in the wrong direction here, but it seems what should be a
simple thing to do is just impossible.
Any ideas? I'm completely stumped...
--
Philip Regan
email@hidden
http://homepage.mac.com/pregan
REALBasic 2005r4, Mac OS 10.3.9, Mac-centric development
Xcode 1.5
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden