I aim to find some words in a same file then that apply to an indicated character style, but it doesn't work.
According the Adobe's notes. :
//More complex example:
//text {findWhat:"^9^9.^9^9"} {appliedCharacterStyle:"price"} {include footnotes:true, include master pages:true, include hidden layers:true, whole word:false} Find $10.00 to $99.99 and apply the character style "price".
I should be able to get what I want. But it gives me an error like this:
but I get this error:
Error Number: 25
Error String: Expected: :
Line 159
Can someone tells me how can fix it.
thanks and please!!!
It seems like you are mixing Javascript notation (camelCase, such as in "appliedCharacterStyle") and AppleScript notation (separate words, such as "include hidden layers"). Perhaps that's where your poor computer got confused. Use the correct notation for the script language you are using.
I do it as your says to separate the script notation, but I got a same error message:
but I get this error:
Error Number: 25
Error String: Expected: :
Line 159
then I look into the VB script line 159 the script is: " myInDesign.DoScript myScript, idScriptLanguage.idJavascript". What is wrong with that script?
then I try the JV script, I got another error message: footnotes not correct. What is wrong with that foot notes?
I think Jongware's right, this example has AppleScript mixed with Javascript, so it won't run completely in either one. AppleScript can't get past the "findWhat", so it bombs out on you there. If you try to run it through Javascript, it's bombing out at footnote part, which is written in AppleScript format.
Try this, through Javascript:
//text {findWhat:"^9^9.^9^9"} {appliedCharacterStyle:"price"} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false} Find $10.00 to $99.99 and apply the character style "price".
or this in AppleScript:
//text {find what:"^9^9.^9^9"} {applied character style:"price"} {include footnotes:true, include master pages:true, include hidden layers:true, whole word:false} Find $10.00 to $99.99 and apply the character style "price".
Thanks for all you guys' patients, who tells me how to fix the find and change error.
thank you so much.
but one thing more I want to ask is how to change back to No style?
How can tell the script what I want to?
North America
Europe, Middle East and Africa
Asia Pacific