5 Replies Latest reply on Jun 24, 2016 8:09 AM by gkaiseril

    switch statement and pagebox help

    sk90887520

      I'm very new to javascript but I'm trying to write a little script to provide some automation based on page size.

      I know that my current document is one of the cases listed, but I cant get the switch statement below to recognize it.

      Any help would be greatly appreciated. I'm using Acrobat Pro 9. Thanks,

       

      function test(){

        var pSize = this.getPageBox("Crop");

        app.alert(pSize, 3);

        switch(pSize){

        case "0,612,792,0": //A

        app.alert("A Size Page", 0);

        break;

        case "0,792,1224,0": //B

        app.alert("B Size Page", 0);

        break;

        case "0,1224,1584,0": //C

        app.alert("C Size Page", 0);

        break;

        case "0,1584,2448,0": //D

        app.alert("D Size Page", 0);

        break;

        default:

        app.alert("Page Size Not Found!", 0);// do this if all else fails

        break;

        }

      }