forgive me for wondering... but wouldn't it be easier/faster to make that change by applying an XSL on XML import?
Loic Agon in a recent blog-post actually covers just that... http://www.loicaigon.com/blog/?p=1014
I struggle so much with Applescript that I didn't even try it that way. I'm sorry if using Applescript is part of your requirements.
This uses xml rules, which walk the xml structure for you, and, in my experience, do it much, much faster than looping through it yourself. (You might need to modify the #include line if you're using a different version or a non-standard install location.)
I'm not sure why you're selecting each element in turn, or why you're changing the measurement units or ruler origins. Selecting things is almost never necessary unless you're building a GUI script that interacts with the user's selection. Maybe this is part of a larger script that relies on the user to do certain things?
Hope this helps.
Jeff thanks so much. This is easier. I just know Applescript so much better than Java.
This is what I needed. I will next have to figure out manipulating images via XML using Jave instead of applescript.
No it wouldn't help.
We are using a propritory XML genreated from a merchant applicaton system that needs to be updated for pricing so manipulating the XML before input is out of the question.
Thanks for your help
I'm glad to help.
For more about xml rules in InDesign, see chapter 13 of the scripting guide.
I would love to learn more about XSL. It sounds very interesting. Just not sure of the time/learning curve invovled.