Copy link to clipboard
Copied
Hi,
I have a series of inDesign files with several interactive buttons. I need to manipulate both the NAME of the buttons, and also the DESCRIPTION of the button.
The DESCRIPTION is the PDF OPTION of the BUTTON AND FORMS pop up window from the INTERACTIVE MENU. I believe the DESCRIPTION is equivalent to 'TOOLTIP' in Acrobat.
So far, I have access to the NAME of the buttons by using the following in JavaScript in inDesign.
for (i = 0 ; i< QtyButtons;i++){
$.writeln("i= ",i," ",myDoc.buttons.name);
}
I could not find the proper code to access ( read ) the button DESCRIPTION.
( buttons.description - buttons.tooltip - ... else ... )
Any help I could get will be greatly appreciated.
Thanks
Gervais
Copy link to clipboard
Copied
Hi Gervais,
I remember, that there were some bugs around button description in CS6 that were only fixed in a later version of CC.
Definitely there is a property description for the button object that takes a string.
See here in Jongware's DOM description that is also available online:
Adobe InDesign CS6 (8.0) Object Model JS: Button
Regards,
Uwe
Copy link to clipboard
Copied
Found the relevant discussion about the bug:
Re: [ESTK] somehow is puzzling: Throwing strange errors on some properties
See here for the versions the issues were fixed:
Re: [ESTK] somehow is puzzling: Throwing strange errors on some properties
As to my knowledge and testing, these issues should be fixed in:
InDesign CC v9.3.0
InDesign CC-2014.2 v10.2.0
CC Simple Save Back Service (the IDML related problems)
The problems are not fixed in CS6 v8.1.0.
Regards,
Uwe
Copy link to clipboard
Copied
Thanks much for this very quick response.
I will have to updgrade to newer inDesign
Rgds
Gervais
Copy link to clipboard
Copied
Hello, I have a simple code that will update names and description of all buttons in InDesign document. I am not sure of CS6, but this script works fine in Indesign CC 2018. Here is the script
function updateButtons()
{
var myDoc = app.activeDocument;
var buttons = myDoc.buttons;
for (var i = 0; i < buttons.length; i++)
{
var btn = buttons;
btn.name = "New Name " + i;
btn.description = "New Description " + i;
}
}
updateButtons()
You can change name and description as per your requirement. Hope this will help you.