3 Replies Latest reply on Dec 7, 2013 11:23 AM by kitfox

    Javascript that worked in CS4 not working in CC

    kitfox

      I wrote a Javascript tool that creates perspective grids in Photoshop a while ago.  It works fine in Photoshop CS4.  However, I've been getting a few emails complaining that it does not work in CC.  I've checked the CC release of the Javascript in Photoshop reference guide, but it appears that nothing has changed relevant to my code since CS4.  Any idea what's happening in PS that is causing this script to fail?

       

      http://kitfox.com/projects/photoshopPersp/Perspective%20Grids.jsx

       

      Full webpage:

       

      http://kitfox.com/projects/photoshopPersp/index.html

        • 1. Re: Javascript that worked in CS4 not working in CC
          c.pfaffenbichler Level 8

          Have the complaining partied deigned to impart the error message or the point at which point and how the operation fails?

           

          Have you taken RulerUnit settings into account in creating the Script?

          • 2. Re: Javascript that worked in CS4 not working in CC
            JJMack Most Valuable Participant

            I saw nothing in the script to set units to pixels so if the user's units are set to percent width and height will always be equal at 100% but I do see .as px which I have never used.

            • 3. Re: Javascript that worked in CS4 not working in CC
              kitfox Level 1

              I've changed the script.  I now create my path layer using the below function.  However, even after explicitly changing the ruler units to PIXELS, the paths I create all seem to be measured in POINTS.  Even if the original ruler unit is PIXELS this still happens.  Is there any way around this (that is backwards compatable)?

               

               

              function createPathLayer(title, subPathArray)

              {

                  var docRef = app.activeDocument;

               

                  var originalUnit = app.preferences.rulerUnits;

               

                  alert("Orig units " + originalUnit);

               

                  app.preferences.rulerUnits = Units.PIXELS;

               

                  var myPathItem = docRef.pathItems.add(title, subPathArray);

                  alert("New units " + Units.PIXELS);

               

                  app.preferences.rulerUnits = originalUnit;

              }