The last line must be rather:
... I getting some error ...
I bet the line number in that error pointed directly at the syntax error Marc mentions.
Hi Marc & Jonware,
Thanks for looking into this. As i have changed the last line of the script but the error is in the object style defining line. Please refer the attached snapshot.
Thanks in advance
Picture 1.png 28.5 K
The problem is almost certainly caused by the "s" on the end of appliedObjectStyle. The error message is far from helpful, but it's often the case that an inexplicable error message is the result of a simple typo.
My script is also stopping on
myInDesign.FindObjectPreferences.AppliedObjectStyle = myDoc.ObjectStyles.Item("MainPic")
(also tried myInDesign.FindObjectPreference.AppliedObjectStyle = myDoc.ObjectStyles.Item("MainPic"))
with the following message;
Public member 'AppliedObjectStyle' on type 'FindObjectPreference' not found.
I have tried the script after removing "s" in it. Now i am getting error like "object doesn't support the property or method 'appliedObjectStyle'". Please look into this and help me out. Herewith i attached the 'error' dialog snapshot.
When i tried this in loop its working fine. Find the script below.
Picture 1.png 28.1 K
Hi Dave any help for my queries. Thanks in advance.
Oh wow! This is the first time I've ever looked at findObject. I was wrong. That "s" belongs there.
To be honest, I wouldn't go about it this way. I'd use findText and look for "^a", then I'd check the first page item of the found text to see if it was one I was interested in.
Thanks for looking into this. I thought Find Object is same like, Find Text, Find Grep & Find Glyph. So i tried it in the same way. Because the search is very specific. If i go with find text ^a, it will find all frames which are placed as inline. Then we have to check the frame properties. So far i have not yet tried it to find and change object's characteristics.
I think assigning object style in the change object preferences only giving trouble. If you got any solution kindly let me know it.
Thanks & Regards