Skip to main content
Known Participant
December 22, 2010
Question

[JS CS5] UserInteractionLevels not working with placeXML

  • December 22, 2010
  • 1 reply
  • 1326 views

I've included "app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll" at the beginning of my script, because I WANT the script to stop whenever a dialog or alert is shown.

But it doesn't work when I use the "myDoc.xmlElements.item(0).xmlElements.item(0).placeXML(myFrame)" command to place imported XML content into a frame. The XML file references a bunch of graphic images, and those images are missing. If I place the XML by hand (without the script) into the frame, I get a dialog box asking me for the location of each missing graphic. But when the XML is placed by the script, it just quietly races ahead and ignores the missing graphics.

I see in the object model there is also an "importExportEvent.userInteractionLevel", but I can't make heads or tails of this.

Any ideas?

This topic has been closed for replies.

1 reply

Participant
December 31, 2010

You can make it not to interact just before placing XML, and again make it to interact after imported.

//

app.scriptPreferences.userInteractionLevel = UserInteractionLevels.neverInteract;

//

myDoc.xmlElements.item(0).xmlElements.item(0).placeXML(myFrame)

//

app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll

Known Participant
January 4, 2011

shunmraj, thank you for your reply. But the problem I'm having is that I WANT the interaction to be on. In other words, I WANT a dialog to appear if images references in the XML are missing. But when I turn on interaction using:

app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll

it doesn't seem to work. User interaction stays off while placing the XML.