These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

console.show() from folder level javascript

sclark1
Registered: Feb 23 2009
Posts: 20
Answered

I must be missing something, why can I not launch the console from a folder level script?
 
Ex.
 
function consoleShow(){
console.show()}

My Product Information:
Acrobat Pro 6.0, Windows
gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4307
Have you tried to run your script from within the JS debugging console?

Where are you calling this function?

If you add the call call to a button, the function works. Add the following JS to the 'Mouse Up' action for a button:

consoleShow();

I have found it is not a good practice to rename system features or use similar names to system features.




George Kaiser

sclark1
Registered: Feb 23 2009
Posts: 20
Thanks George,
I'm launching it through an added menu item on the toolbar.
sclark1
Registered: Feb 23 2009
Posts: 20
George,
Here's the script, I'd like to open the console after this has printed the contents of the combo box to it.

app.addMenuItem({ cName: "Extract ComboBox Menu List", cParent: "Tools", nPos: 0, cExec: "extractComboBoxList()"});

function extractComboBoxList()
{
var a = app.response("Enter a combo box field name","Input")

var f = this.getField(a);

var v = f.getItemAt(0);

for (var i=0; i < f.numItems; i++)
console.println(f.getItemAt(i,true))
console.show()
;
}
gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4307
Accepted Answer
I do not see the need for a special function to open the console. Your whole process removes only one character to open the console.

Have you tried your code in the JavaScript console?

Were exactly have you placed the above code?

I would open and clear the console before getting the field object, so if there is a problem it shows up.

George Kaiser

George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
It works for me. Have you tried closing Acrobat and trying again?
sclark1
Registered: Feb 23 2009
Posts: 20
Ok now it's working, thanks George and George. I added in a console.clear as well.