7 Replies Latest reply on Aug 8, 2012 8:59 AM by AndrewL504

    Executing JavaScript in X Pro on Mac

    AndrewL504

      Hello,

       

      I recently switched from Windows 7 with Acrobat 9 Standard to Mac OS X 10.8 with Acrobat X Pro.

       

      On my windows setup, I could copy javascripts into Acrobat's "Javascripts" folder and those actions would appear on the Document menu. I've copied those same scripts to my Javascript folder on the Mac, but they don't seem to appear.

       

      I believe the proper Javascripts folder is:

       

      /Applications/Adobe Acrobat X Pro/Adobe Acrobat Pro.app/Contents/Resources/JavaScripts

       

      Now that I've dropped the javascripts in there, and restarted Acrobat, I can't seem to find the place to actually run the scripts. In other words, there is no Documents menu, so I'm not sure where those scripts are. I've enabled JavaScript in Acrobat Preferences, and there is a "JavaScript" section on the tools menu, but my scripts don't appear anywhere.

       

      The two scripts I'd like to add are a "Reverse Order" script that reverses the page order, and a "flatten" tool that flattens all comments on the document.

       

      Please help, and many thanks in advance.

        • 1. Re: Executing JavaScript in X Pro on Mac
          D Zurn Level 1

          I think yo're putting the Javascripts into the wrong folder. The Javascripts now go into Application Support, not inside the Acrobat app itself.

           

          Try this location:

          ~/Library/Application Support/Adobe/Acrobat/10.0/JavaScripts/

           

          As you also discovered, Acrobat 10 got rid of a bunch of main menus, so now any of your Javascript menu items are automatically added instead in the Tools -> Plug-in Add-on Tools twist-down menu.

           

          Hope this helps

          Darryl

           

          Message was edited by: D Zurn [update missplelling]

          • 2. Re: Executing JavaScript in X Pro on Mac
            AndrewL504 Level 1

            Thanks, Darryl.

             

            The location you mentioned doesn't exit. There is no "Acrobat" folder. The only folder is "Acrobat 10 AMT." In fact, there is no "Javascript" folder anywhere underneath "~/Library/Application Support/Adobe".

             

            I was able to find a script that's updated for Acrobat X and flattens documents It's available here.

             

            Unfortunately, I can't find the menu items you're talking about. I know where Tools is, but I don't see a Plugins Tab or know how to enable it.

            • 3. Re: Executing JavaScript in X Pro on Mac
              Test Screen Name Most Valuable Participant

              I don't think you're looking in ~/Library/Application Support/Adobe. I think you're looking in /Library/Application Support/Adobe. ~ is a Unix thing meaning 'my home directory'.

               

              The idea is that these files are personal and don't require administrative privilege to install. Ordinary users can't necessarily change the Acrobat app or /Library.

              • 4. Re: Executing JavaScript in X Pro on Mac
                D Zurn Level 1

                As Test Screen Name pointed out, I meant to point out the folder in your user directory (~).

                 

                You probably won't see the Plug-in Add-on Tools tab until there's something in there to show.

                 

                Darryl

                • 5. Re: Executing JavaScript in X Pro on Mac
                  AndrewL504 Level 1

                  Ok. I've moved the Javascripts to the proper directory, but still don't have the Plug-in Add-on Tools tab anywhere. I also can't seem to find an option that would enable or disable it.

                   

                  Any more ideas?

                   

                  Thanks

                  • 6. Re: Executing JavaScript in X Pro on Mac
                    D Zurn Level 1

                    One way to be sure that you have the corrct folder for the Javascripts is that Acrobat places two files in the Javascripts folder.

                     

                    You should see "glob.js" and/or "glob.settings.js" files in that folder. If at least one file is present, then you've got the right folder.

                     

                    Next, check that Javascript is enabled in the preferences: Acrobat -> Preferences -> Javascript, and make sure that the box for "Enable Acrobat JavaScript" is checked.

                     

                    You should be good to go. You might need to restart Acrobat for the prefs to take effect.

                     

                    Darryl

                    Enable JavaScript.png

                    • 7. Re: Executing JavaScript in X Pro on Mac
                      AndrewL504 Level 1
                      • The folder seems to be correct because the files are there.
                      • Javascript is Enabled.
                      • I have restarted Adobe without any luck.