2 Replies Latest reply on Jan 23, 2014 9:49 PM by cameronmcefee

    ActionReference crashes certain PSCC installs

    cameronmcefee Level 1



      I've got a few users of GuideGuide reporting that GuideGuide crashes Photoshop. I am not able to reproduce this error myself. I've been sending them various panels that segment the actions to determine what is causing the crashes and so far it seems that executing ActionReference commands, both in ExtendScript and via the csawlibs are at the source of the problem.


      The following code will crash Photoshop for them reliably (I cannot reproduce it myself).


      function getOffsets() {

        var ref = new ActionReference();

          ref.putEnumerated( charIDToTypeID("Dcmn"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") )

        var desc = executeActionGet(ref)

        var xOffSet = desc.getInteger(stringIDToTypeID('rulerOriginH'))

        var yOffSet = desc.getInteger(stringIDToTypeID('rulerOriginV'))

        return [xOffSet/65536, yOffSet/65536]



      I've been using some variation of this code for over 3 years and have never had an issue with it until last week. The user that is most actively helping debug this mentioned that the problem started happening in a previously working panel after a recent Creative Cloud update, and exists in a new version of the panel that runs on entirely different code (except for the ActionReference stuff). Has something changed that has broken this process?


      Any help would be greatly appreciated. I don't know of any other way to get the ruler offsets of a document, so I'd love to find a solution.


      Here's a link to the current support thread: https://github.com/guideguide/support/issues/3


      The user @kropecius experiences crashes when focusing on fields, which I've been able to confirm happens when GuideGuide checks photoshop for environment information (the code above).


      The user @skynebula experiences crashes when the panel opens but not in the context that @kropercius mentions. GuideGuide checks for info when it initializes, so his issue may unrelated, or if the problem is in the ActionRefrence itself, may be some core issue that's causing different symptoms for different people.


      Also potentially related, a select set of users claim that GuideGuide doesn't add guides. I haven't fully investigated this yet, but as guide adding is being done via ActionReference I think it may be connected. (Adding guide via csawlib seems to have a bug that doen't automatically enable guide visiblility so I'm stuck using ActionReference).


      (This is a dupe post of http://forums.adobe.com/thread/1388037. I'm not sure the proper place to post this. Once I figure out which one is appropriate I'll close the other. )