问题
I want to edit some textframe content in Indesign documents by JS. But I cannot find any solution to get any change with feedback in Dialog Window. So I just have a simple document with one Textframe with name test
I just paste relevant parts to keep it simple, in my Dialog I have lot of settings...
var w = new Window ("dialog","DialogTitle");
var changeText = w.add("button", [0,0,150,20], "change test Text");
changeText.onClick = function(){
w.close(1);
}
var result = w.show();
if (result == 1){
myFrame = app.activeDocument.textFrames.itemByName("test");
myFrame.contents = "New Text";
var result = w.show(0); //Here I want to reopen the Window w
//Is not working
}
you could not make any changes while Dialog is shown. But how I get Dialog back?
回答1:
To keep your custom window and UI access define this window as "palette" instead of "dialog".
Your script 1st directive supposes to call your custom targetengine as well, something like: #targetengine "mysession"
来源:https://stackoverflow.com/questions/33660013/indesign-script-js-edit-document-textframe-content-and-get-back-to-dialog-windo