5 Replies Latest reply on May 27, 2014 1:36 AM by Laubender

    JavaScript script: How to add a DSP Interactive WebView to a page?

    ade90036

      Hi forums experts,

       

      I'm working on a project where we want to automate the insertion in a indesign (*.indd) of a DSP WebView using a JavaScript (*.jsx) script.

       

      I did an extensive research of the JavaScript API but i could NOT find any reference of the "DSP", "WebView".

       

      Is this possible?

       

      Is there a hidden API located somewhere?

       

      What is an alternative? IDML?

       

      Any help would be extremely appreciated.

       

      Regards

        • 1. Re: JavaScript script: How to add a DSP Interactive WebView to a page?
          Laubender Adobe Community Professional & MVP

          Do you mean DPS (Adobe Digital Publishing Suite)?
          If yes, I'd ask this sort of question in the DPS forum:

           

          Digital Publishing Suite

           

          Uwe

          • 2. Re: JavaScript script: How to add a DSP Interactive WebView to a page?
            Harbs. Level 6

            I believe DPS uses script labels for its features. If you export an IDML file, you should be able to see how it's done.

            • 3. Re: Re: JavaScript script: How to add a DSP Interactive WebView to a page?
              Laubender Adobe Community Professional & MVP

              @Harbs – right. DPS is using script labels for the properties of an overlay.

              Regarding WebView: that cannot be applied to a page, but to a container object like a rectangle.

               

              So, I'm not sure what the OP is asking: Web Articles in the sense of usage in DPS?

              This is no overlay feature and cannot be scripted with setting script labels.

               

              For overlays applied to a container on a page we can check an IDML for the following basic code. The key/value pairs might change, when DPS is evolving (this example stems from an older version of DPS):

               

              <Label>
                  <KeyValuePair Key="Type" Value="WebView"/>
                  <KeyValuePair Key="URL" Value="http://www.adobe.com"/>
                  <KeyValuePair Key="UseTransparentBackground" Value="true"/>
                  <KeyValuePair Key="AutoStart" Value="true"/>
                  <KeyValuePair Key="AutoStartDelay" Value="0.5"/>
                  <KeyValuePair Key="ScaleContentToFit" Value="true"/>
              </Label>
              

               

              Uwe

              • 4. Re: Re: JavaScript script: How to add a DSP Interactive WebView to a page?
                ade90036 Level 1

                What i was asking is how to create that "WebView" using JavaScript in InDesign,

                 

                Laubender, i've noticed that XML too, by inspecting thr IDML saved file.

                 

                So what i've done is create an javascript to create a rectangle and add in the exact labels specified in the IDML file (also reported in the previous post).

                 

                AND IT WORKS.

                 

                var myRectangle = myPage.rectangles.add({geometricBounds:[myPageMarginTop, myPageWidth-75-myPageMarginRight, myPageMarginTop+75, myPageWidth-myPageMarginRight]});

                                myRectangle.insertLabel("kAdobeDPSInteractivity_Type", "WebView");

                                myRectangle.insertLabel("kAdobeDPSInteractivity_URL", "/Magazine/codes/index.html");

                                myRectangle.insertLabel("kAdobeDPSInteractivity_UseTransparentBackground", "true");

                                myRectangle.insertLabel("kAdobeDPSInteractivity_ScaleContentToFit", "false");

                                myRectangle.insertLabel("kAdobeDPSInteractivity_IsTrustedContent", "true");

                                myRectangle.insertLabel("kAdobeDPSInteractivity_AutoStart", "true");

                                myRectangle.insertLabel("kAdobeDPSInteractivity_UserInteractionEnabled", "true");

                 

                Regards

                • 5. Re: Re: JavaScript script: How to add a DSP Interactive WebView to a page?
                  Laubender Adobe Community Professional & MVP

                  @ade – see, all the key strings have changed, one key/value string combination was added to reflect the change in functionality, if you compare an old DPS version to a newer one. This could always change again, if a totally new version of DPS comes out.

                   

                  Uwe