PDF Automation Station

PDF Automation Station

Popup Dialog Hacks for Acrobat Pro: Part I

How to order items in a dialog popup control or dialog list box non-alphabetically. BONUS: How to add section dividers to your popup control and list box lists.

David Dagley's avatar
David Dagley
Sep 13, 2025
∙ Paid
green circuit boards
Photo by Kaur Kristjan on Unsplash

Can you program this dialog list box?

Dialog list box with separators and non-alphabetic order

Keep reading to find out how.

Programming Dialog Basics


Popups and Browse Windows Part V

Popups and Browse Windows Part V

David Dagley
·
Mar 8
Read full story

Popups and Browse Windows Part VI

Popups and Browse Windows Part VI

David Dagley
·
Mar 15
Read full story

Popups and Browse Windows Part VII

Popups and Browse Windows Part VII

David Dagley
·
Mar 22
Read full story

Undocumented

What does it mean? It means you won’t find it in the official documentation. It doesn’t mean, however, that is doesn’t work. Theoretically it could disappear at any time with a new release of the software. It hasn’t happened so far with any of the undocument tricks I use. I think they are there for the use of the software User Interface (UI) and not meant for general use - but they are accessible through the JavaScript engine. Use them if you want. Or don’t.

edit_text, PopupEdit, SpinEdit, popup, list_box - WTF?

I apologize for the crude acronymn above, but I don’t really know how to express what I’m feeling in a more succinct way (I told my Mom it stands for Why The Face). The documentation provides an example of how to load a list_box element and then states:

“In the example above, if the line type: "list_box" is replaced by type: "popup" and the height specification is removed, the example will run with a pop-up control rather than a list box.”

So far so good. Both work without issue:

//Run this list box in the console:
var dlg={
initialize: function (dialog)
{
dialog.load({"list":
{
"D":-1,
"C":1,
"B":-1,
"A":-1
}
})
},
description:{
elements:
[

{
type: "list_box",
width: 200,
height: 60,
item_id:"list",
},

{
type:"ok_cancel",
}
]
}};
app.execDialog(dlg);
//Run this popup in the console:
var dlg={
initialize: function (dialog)
{
dialog.load({"list":
{
"D":-1,
"C":1,
"B":-1,
"A":-1
}
})
},
description:{
elements:
[

{
type: "popup",
width: 200,
//height: 60,
item_id:"list",
},

{
type:"ok_cancel",
}
]
}};
app.execDialog(dlg);

Notice the list is coded in this order: D, C, B, A - but the list displays as A, B, C, D? Keep that in mind as you read through to the solution, the point of this article, which is how to set the list in any order you choose.


Get the course above, and a suite of automation tools for FREE with a Professional subscription.


This post is for paid subscribers

Already a paid subscriber? Sign in
© 2025 David Dagley
Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture