Skip to main content
Known Participant
Aug 29, 2018 12:43 PM UTC
Question

two actions in one marker

hello a query, I have a bookmark which I want to have two actions, the first would be an alert and the other to open a file .....

Can it be done using javascript? to save time

This topic is closed to new replies. Start a new post to keep the conversation going.

7 replies

DEMAuthor
Known Participant
Aug 29, 2018 2:25 PM UTC

ok muchas gracias

Translate
DEMAuthor
Known Participant
Aug 29, 2018 1:01 PM UTC

ok muchas gracias

Translate
DEMAuthor
Known Participant
Aug 29, 2018 12:53 PM UTC

to ok where can i look for information to do that

Translate
try67
Community Expert
Community Expert
Aug 29, 2018 12:55 PM UTC

This forum is an excellent resource... Try searching it for relevant keywords.

Also, see: Adobe - Acrobat Developer Center | Adobe Developer Connection

And: https://acrobatusers.com/tutorials/

Translate
DEMAuthor
Known Participant
Aug 29, 2018 1:18 PM UTC

var CustomAlert =

{

    result:"cancel",

    DoDialog: function(){return app.execDialog(this);},

    initialize: function(dialog)

    {

        var dlgInit =

        {

            "img2":

                {

                    "width":100,

                    "height":33,

                    offset: 0,

                    "read": function(bytes){return asdf.slice(this.offset,this.offset+=bytes);}

                },

            "stat": "Usted esta por abrir un archivo que fue firmado digitalmente por el GCBA\nEl cual contiene un archivo adjunto con el libro de sueldo correspondiente",

        };

        dialog.load(dlgInit);

    },

    commit: function(dialog)

    {

        var oRslt = dialog.store();

    },

      mylk:function(dialog){ app.launchURL("www.infobae.com.ar");},

    description:

    {

        name: "Custom Alert",

        elements:

        [

            {

                type: "view",

                elements:

                [

                    {

                        type: "view",

                        align_children: "align_top",

                        elements:

                        [

                            {

                                type: "image",

                                item_id: "img2",

                                width: 100,

                                height: 33,

                                char_width: 4,

                                char_height: 4,

                            },

                            {

                                type: "static_text",

                                item_id: "stat",

                                width: 220,

                                height: 64,

                                alignment: "align_fill",

                                font: "dialog",

                                bold:"true"

                            },

                        ]

                    },

                    {

                        type:"button",

                        item_id:"mylk",

                        name:"WWWW.infobae.com.ar",

                        },

                        {

                            type: "ok",

                            ok_name: "Continue",

                        },

                ]

            },

        ]

    }

};

// Example Code

if("ok" == CustomAlert.DoDialog())

{

}

this is the code I have for the alert, how can I make the accept button open a pdf file?

so I do not have to create two actions, so I have

Translate
try67
Community Expert
Community Expert
Aug 29, 2018 12:46 PM UTC

JavaScript can only create JS-based actions, and only one of them.

You can do both things in a single JS-action, though.

Translate