0

I tried this code:

tell application "Adobe InDesign CS6"
   set ParaIdOrSecId to "ti0005"
   set xpa to "//*[@*='" & ParaIdOrSecId & "']" as string
   tell active document
      tell XML element 1    
         set Requriedxpa to evaluate XPath expression using xpa 
      end tell
   end tell
end tell

After executing, InDesign Shows a dialog box:

Content contains characters which cannot be encoded.

Why am I not able to execute it, even though its a valid xpath?

jcsanyi
  • 8,133
  • 2
  • 29
  • 52
robin
  • 25
  • 6
  • InDesign speaks about the _content_. Have you looked at it? Can you provide minimal example content to reproduce the issue (read about [building an sscce](http://www.sscce.org))? – Jens Erat Jul 10 '13 at 08:18
  • hi jens erat Indesign Content contains Indent to her tab thats y it shows "Content contains characters which cannot be encoded". – robin Jul 12 '13 at 04:29

1 Answers1

1

This problem is not limited to XPath, I know it from other XML features such as export. One typical character to cause the dialog is the right aligned tab (entered as shift-tab). With export it helps to just disable the dialog, because the dialog is wired straight into internal XML streaming and does not produce an error / exception:

set user interaction level of script preferences to never interact
Dirk
  • 666
  • 3
  • 6
  • thanks Dirk,it works,Indesign Contents contains Indent to her tab thats y i can't execute this code – robin Jul 12 '13 at 04:27