Skip to main content
Known Participant
August 29, 2018
Question

two actions in one marker

  • August 29, 2018
  • 4 replies
  • 929 views

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 has been closed for replies.

4 replies

DEMAuthor
Known Participant
August 29, 2018

ok muchas gracias

DEMAuthor
Known Participant
August 29, 2018

ok muchas gracias

DEMAuthor
Known Participant
August 29, 2018

to ok where can i look for information to do that

try67
Community Expert
Community Expert
August 29, 2018

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/

DEMAuthor
Known Participant
August 29, 2018

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

try67
Community Expert
Community Expert
August 29, 2018

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

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