Jongware, thank you again!
yes ... now you help me a bit to identify methods and variables. :-)
but nevertheless at the moment i don't understand how i can systematicly reach a value or function.
in php for example i can print out a whole object or array (print_r()) and can systematicly fetch that what i need ...
now i have upped my (cleaned) .indd here.
there you can see, at every header is a button with the action gotourl and the value: "navto://lbt_einstieg_h" <- and I want to search and replace that to (for example) to "navto://XYZ_einstieg_h" on every page in the document.
There are more buttons in the upper right side for open and close a hover <- they should be untouched by the script.
could you please took a look about it?
thanks,
Christian
Something like this? This code inspects all buttons in the document and gathers the ones with a single gotoURLBehavior. It shows the list in a simple dialog, where you can also enter a new URL. Press OK to change the listed URLs, or Cancel to bail out.
If the dialog shows other URLs than the one(s) you want to change, you'll have to devise a way to discern these. (Although another way could be to add checkboxes for each one to change, but that's a bit more work
)
allButtons = app.activeDocument.buttons;
urlButtons = [];
urls = [];
for (i=0; i<allButtons.length; i++)
{
if (allButtons.gotoURLBehaviors.length == 1)
{
urlButtons.push (allButtons);
urls.push (allButtons.gotoURLBehaviors[0].url);
}
}
urlDialog = app.dialogs.add ({name:"URL buttons",canCancel:true});
with (urlDialog)
{
with (dialogColumns.add())
{
for (i=0; i<urls.length; i++)
staticTexts.add ({staticLabel:urls});
edBox = textEditboxes.add({editContents:"http://www. ...", minWidth:240});
}
}
if (urlDialog.show())
{
for (i=0; i<urlButtons.length; i++)
urlButtons.gotoURLBehaviors[0].url = edBox.editContents;
}