Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


Title of Dialog not displaying

Explorer ,
Jul 17, 2021 Jul 17, 2021

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?

 

TOPICS
JavaScript, PDF forms

Views

46

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 2 Correct answers

Adobe Community Professional , Jul 17, 2021 Jul 17, 2021
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. Othe...

Likes

Translate

Translate
Adobe Community Professional , Jul 17, 2021 Jul 17, 2021
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.

Likes

Translate

Translate
Adobe Community Professional ,
Jul 17, 2021 Jul 17, 2021

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

 

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 17, 2021 Jul 17, 2021

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.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Jul 17, 2021 Jul 17, 2021

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).

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 17, 2021 Jul 17, 2021

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!

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Jul 17, 2021 Jul 17, 2021

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.

 

radzmar_0-1626553265512.png

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 17, 2021 Jul 17, 2021

Copy link to clipboard

Copied

LATEST

radzmar...

 

yeah. Bummer right!

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines