3 Replies Latest reply on Sep 23, 2018 5:09 AM by Laubender

    Use actual page size in AppleScript, not document setup size.

    lucas.maximus Level 1

      Hi all,


      Hope somebody could point me in the right direction...


      I have a droplet app written in AppleScript. It looks for the page size of the documents dropped and uses that info. Just for testing I have a dialog at the end which returns this.


      The problem;

      The app only returns the document size, as in the size displayed in the 'Document setup' window. I need to use the actual page size, as a large number of my clients use the page tool to adjust the page sizes. I need it to always use the actual page size.


      Has anyone run into a similar problem?


      My code is below, thanks in advance for any help



      on open mgItems

        repeat with mgThisItem in mgItems

        tell application id “com.adobe.InDesign”


        open mgThisItem


        tell active document


        my get_documentSizes()


        tell document preferences


        tell document preferences

        set overallwidth to page width

        set overallHeight to page height


        end tell


        end tell






        end tell


        close active document


        on error

        -- decide what kind of error handling you want to include if the file won’t open

        end try

        end tell

        -- rest of script for email processing here

        end repeat

        display dialog overallwidth

      end open