Hmmm, can't tell if sstanley replied or not. It is blank on my screen right now.
At any rate, I would suggest you need to do it on a per page basis.
Something like: apply smart style digestStyle to page item "Table Box" of page 1 of theDoc
FWIW, an excellent way to debug is to manually apply the smart style to the appropriate object, select the object and then run the script
tell application "Adobe InDesign CS3"
get properties of selection
That way, you can see all the attributes of the selected item, including its parent and exactly what the correct value is of the attribute you are trying to change.
Then you undo and try and apply them via script.
>can't tell if sstanley replied or not
He did, but the forum software ate it again.
if the dictionary says "apply smart style asset", then smartStyles should be a reference to an asset, not a library as appears in the posted code.
Well, "digestStyle" is the variable for my asset from the library and "smartStyles" is the variable I used to refer to the library itself, so that really wouldn't matter if I switch them around since they are just variables. Or am I missing something? My thinking was that the dictionary more or less meant "apply smart style <insert asset name here>" ...hence the syntax I gave, "apply smart style digestStyle." Does that make sense? I appreciate the help!
Thanks for your reply. "Reverse engineering" applying the smart style is a good suggestion and a technique I have used in the past with other scripts, but I did not think to use it here. I will definitely try that when I get back to the office. Trying it one page at a time is also worth a shot, I think. This is page 1 of a multipage document with linked text boxes, so I may try "parent story" and a few other tricks.
If I'm still stuck, I'll post back on Monday. Thanks to both of you for replying!
Yes, that makes sense -- I misread your original script.
Nice work, man. That was exactly it:
apply smart style digestStyle to page item "Table Box" of page 1 of theDoc
It's always something seemingly insignificant that makes the difference, isn't it? Thanks to Eric for the answer and to both of you for your help!