Hi List,
I am relatively new to AppleScript and by new I mean that I have never used it for, or scripted anything of significance.
I was asked if I could update a script that was written for InDesign CS2 so that it would work in InDesign CS4. Not being a scripting guru and never wring anything close to this, I figured that I would give it a try (maybe even learn something). Anywhoo, the script that I am working on needs to search within the Paragraph and Character style "groups" (nested folders) to find/change the style name. In CS2 there were no style groups so when the script is run in CS3 it doesn't search/replace within the Paragraph and Character Style groups (folders), it only searches outside of the nested folders.
here is part of the script:
--This list is for paragraph styles set myPStyleList to {¬ {"Must be last line in squiggely braces", "Do not touch", "n"} ¬ }
--Clean up style lists by removing last "squiggely braces" item set myPStyleList to items 1 thru ((length of myPStyleList) - 1) of myPStyleList
tell application "Adobe InDesign CS3" tell active document set successPCounter to 0 set successPDelete to 0 set successCCounter to 0 set successCDelete to 0 set notedErrorCounter to 0
--Do paragraph styles repeat with thisPStyle in myPStyleList set newPStyle to item 1 of thisPStyle set oldPStyle to item 2 of thisPStyle set noteError to item 3 of thisPStyle set docPStyles to (name of every paragraph style whose name does not start with "[") if docPStyles contains newPStyle then if docPStyles does not contain oldPStyle then
I thought that if I changed the line set docPStyles to (name of every paragraph style whose name does not start with "[")
to set docPStyles to (name of all paragraph styles whose name does not start with "[")
that there would be joy. Alas there was no joy to be had and I received the following message: WARNING Can't get name of all paragraph styles of active document of application "Adobe InDesign CS3" whose not 32. Access not allowed.
I would greatly appreciate any assistance in figuring this out.
Thank you, Curt |