3 Replies Latest reply on Dec 29, 2015 10:11 AM by gkaiseril

    Scripting use of the clipboard

    BR001 Adobe Community Professional & MVP
      Does anyone know if it is possible, using JavaScript, to 'paste' text into the Windows clipboard.

      The closest thing I can find is an app.execMenuItem("Copy"); or app.execMenuItem("CopyFileToClipboard"); but don't know how I would make the selection and ideally I would like to avoid having "dummy" fields just to have a source for the copy.

      Thanks
        • 1. Re: Scripting use of the clipboard
          gkaiseril MVP & Adobe Community Professional
          Not possible. Acrobat/Reader tends to work constantly on more than OS so there are not alot of features that are OS specific. One exception are the mail functions.

          you can create a report through Acrobat JavaScript and then save that report as a text file.
          • 2. Re: Scripting use of the clipboard
            ssnir2004

            it's working:

             

             

            Private Sub SetAcroObjectOnClipboard()

                Dim app As Object, avdoc As Object, pddoc As Object, jso As Object

             

                Set app = CreateObject("AcroExch.App")

                Set avdoc = app.GetActiveDoc

              

                Set pddoc = avdoc.GetPDDoc

                avdoc.BringToFront

                Set jso = pddoc.GetJSObject

                jso.app.execMenuItem "CopyFileToClipboard"

              

                Set AcroApp = Nothing

                Set AcroAVDoc = Nothing

             

                On Error Resume Next

              

                'Show the adobe application

                app.Show

             

            End Sub

            • 3. Re: Scripting use of the clipboard
              gkaiseril MVP & Adobe Community Professional

              That looks like VBA script which is calling the "AcroExchApp" and then using the JSO to externally control Acrobat or Reader.