Copy link to clipboard
Copied
Hi Everyone...
Using the AcroDialog tool on Thom Parker's site....what a great tool...
I used the simple dialog that loads up with the tool.
////////////////////////////////////////////////////////////////
// Acrobat JavaScript Dialog
//
var oJSDlg = {
initialize:function(dialog){
},
validate:function(dialog){
var bRtn = true;
var oRslt = dialog.store();
return bRtn;
},
commit:function(dialog){
var oRslt = dialog.store();
},
description:{
name:"Dialog Box",
elements:[{type:"view",elements:[
{
type:"static_text",
item_id:"Sta1",
name:"Insert Dialog Elements Here",
},
{
type:"ok_cancel",
},
]}]
}
}
if("ok"==app.execDialog(oJSDlg))
{
}
It runs and displays the dialog...but for some reason, the name:"Dialog Box", of the dialog does not display. Instead, a "JavaScript Window" label does...
What am I not getting?
Adobe is very security concious. I think some time around Acrobat 8 or 9 they added anti-spoofing warnings to all the popup dialogs that are executed from a non-privileged context. Which also means the Title doesn't get displayed. At some point, both the title and the warning message were displayed, but now it's just the warning 😞
To get rid of the warnings and display the title the code must be run from a privileged context. If this is an automation script, then use a trusted function. Oth
...Thom's sample works as expected. For security reasons you'll get noticed when a dialog windows is created by JavaScript from an untrusted environment like a button in the form. Only if execute this script from a trusted environment like the JavaScript console or a folder level script, you will see get a dialog without any warning.
Copy link to clipboard
Copied
Adobe is very security concious. I think some time around Acrobat 8 or 9 they added anti-spoofing warnings to all the popup dialogs that are executed from a non-privileged context. Which also means the Title doesn't get displayed. At some point, both the title and the warning message were displayed, but now it's just the warning 😞
To get rid of the warnings and display the title the code must be run from a privileged context. If this is an automation script, then use a trusted function. Otherwise you'll need to use one of the other trust mechanisms, or just live with the warning.
You can read all about trust and privilege here:
https://www.pdfscripting.com/public/Trust-and-Privilege-in-Acrobat-Scripts.cfm
Copy link to clipboard
Copied
Thanks, Thom.
As a line in a well-known movie says "Am I reaching for the stars here?"...
I'll have to live with the warning as it will take an act of God to get privileged scripts propagated to the user level.
Copy link to clipboard
Copied
It's not documented but it will only show if you run the code from a privileged context, such as a trusted function in an app-level script. Annoying, right? And that's on top of that super-annoying warning red text at the bottom of the dialog (which will also disappear if you run it from that context, by the way).
Copy link to clipboard
Copied
Thanks, try67...
Yes, a newbie, I'm finding these things out...
Thank you for thinking about my issues and guiding me....very much appreciated!
Copy link to clipboard
Copied
Thom's sample works as expected. For security reasons you'll get noticed when a dialog windows is created by JavaScript from an untrusted environment like a button in the form. Only if execute this script from a trusted environment like the JavaScript console or a folder level script, you will see get a dialog without any warning.
Copy link to clipboard
Copied
radzmar...
yeah. Bummer right!