4 Replies Latest reply on Dec 14, 2011 2:12 PM by George_Johnson

    Changing the appearance of an app.alert

    Teresa 2016 Level 1

      I have this message that shows whenever the file is opened. 


      Is there a way to change the font style or colors to make it more appealing the to eye?


      here is the javascript...


      Also, is there any way to change the message box title - Warning - JavaScript Window- to something else?

        • 1. Re: Changing the appearance of an app.alert
          Dave Merchant MVP & Adobe Community Professional

          No, and no. The alert dialog is generated by the application, so it looks like any other dialog - it will be OS-skinned but you can't control that from within the document. There are parameters to control which icon is shown (info, warning, error, etc.) and which buttons (ok, cancel, etc.). App.response can format controls on the dialog (text fields, buttons, etc.), but that's it.


          The security note in the title is always shown when the script is running in a non-elevated context, such as from within a document. App-level scripts can run as tructed functions, which turn the warning off, but they must be installed by the user. The warning is an important security feature because a dialog box could be shown which mimics something else (e.g. a software activation window), and the user must be warned that because it's coming from within the document, it may not be entirely trustworthy.

          • 2. Re: Changing the appearance of an app.alert
            Teresa 2016 Level 1

            Is there another way for a similar message box to appear when a page or file is opened?

            • 3. Re: Changing the appearance of an app.alert
              try67 MVP & Adobe Community Professional

              Each page has a PageOpen action, in which you can insert a code that shows an alert.

              • 4. Re: Changing the appearance of an app.alert
                George_Johnson MVP & Adobe Community Professional

                It is possible to create a custom dialog, where you have more flexibility on the layout and can use a bold font, but these can be complicated. For some samples, see: http://www.windjack.com/product/acrodialogs/


                Another alternative that isn't a popup is to add a button to the first page that is displayed when the form is opened. A button can have any appearance you want. When the user clicks it, it can then be hidden:


                //Mouse Up script for button

                event.target.display = display.hidden;


                To show it:


                // Show message button (named "message")

                getField("message").display = display.noPrint;