Copy link to clipboard
Copied
Hi
With JavaScript, is there a way to detect whether the user is using the new Acrobat interface or the old one?
Context: I'd like to detect the interface for adding a menu item, i.e. in the Edit (or File) menu if it's the old interface, or in the Hamburger menu (which has been renamed AV2::HamburgerMenu) if it's the new one.
Also, what's the best way to detect whether it's the Mac or Windows version?
app.platform or other?
Because this menu change doesn't concern the Mac version.
Thank you
Acrobate du PDF, InDesigner et Photoshoptographe
Copy link to clipboard
Copied
Yes there is!!
The new UI has a different menu structure, and the first item is the "Hamburger" Menu.
this line of code:
app.listMenuItems()[0].cName
In the Old UI returns "File".
In the New UI returns "AV2::HamburgerMenu".
Use the Acrobat JavaScript Reference early and often
Copy link to clipboard
Copied
This should cover all scenarios:
if(/AV2::HamburgerMenu/.test(app.listMenuItems()))
{
app.addMenuItem({
cName:"MyTestMenuItem",
cParent:"AV2::HamburgerMenu",
cExec:"app.alert('');",
nPos:0
})
}
else
{
app.addMenuItem({
cName:"MyTestMenuItem",
cParent:"File",
cExec:"app.alert('');",
nPos:0
})
}
Copy link to clipboard
Copied
I hope they never remove the ability to revert to the old UI because this new one is an insult to productivity, flexibility, and common sense.
Copy link to clipboard
Copied
Yes there is!!
The new UI has a different menu structure, and the first item is the "Hamburger" Menu.
this line of code:
app.listMenuItems()[0].cName
In the Old UI returns "File".
In the New UI returns "AV2::HamburgerMenu".
Use the Acrobat JavaScript Reference early and often
Copy link to clipboard
Copied
Answered tool fast, you've already got that. So does the menu item method not work on the Mac?
Use the Acrobat JavaScript Reference early and often
Copy link to clipboard
Copied
Thanks for this line of code, I didn't know about this method.
In the Mac version the new UI has kept the File, Edit, View, etc. menus, so the problem doesn't arise.
Acrobate du PDF, InDesigner et Photoshoptographe
Copy link to clipboard
Copied
Just tested on the Mac app.listMenuItems()[0].cName returns "Apple", the File menu is in 2nd position.
So I really need to test the platform too 😉
Acrobate du PDF, InDesigner et Photoshoptographe
Copy link to clipboard
Copied
I'm at a loss then. So what's different on the Apple New UI? Is there something else in the menus, or tool buttons?
Use the Acrobat JavaScript Reference early and often
Copy link to clipboard
Copied
This should cover all scenarios:
if(/AV2::HamburgerMenu/.test(app.listMenuItems()))
{
app.addMenuItem({
cName:"MyTestMenuItem",
cParent:"AV2::HamburgerMenu",
cExec:"app.alert('');",
nPos:0
})
}
else
{
app.addMenuItem({
cName:"MyTestMenuItem",
cParent:"File",
cExec:"app.alert('');",
nPos:0
})
}
Copy link to clipboard
Copied
I'm at a loss then. So what's different on the Apple New UI? Is there something else in the menus, or tool buttons?"
As you probably know, Apple's guidelines are strict, requiring a fixed menu bar (at the top of the screen) containing a set of menus with the same name in all applications.
In the "new experience" the menus have not changed and still contain the same items. What has changed is that the tool and navigation panels have been inverted (right/left) and the toolbar floats over the document. Leaving a large empty space above the document, as in the Windows version (I sincerely hope the “genius” who invented this will rots in hell for the rest of eternity 😉 ).
Acrobate du PDF, InDesigner et Photoshoptographe
Copy link to clipboard
Copied
I hope they never remove the ability to revert to the old UI because this new one is an insult to productivity, flexibility, and common sense.
Copy link to clipboard
Copied
Thanks, that's pretty much what I had in mind, I'll use your script.
Acrobate du PDF, InDesigner et Photoshoptographe

