3 Replies Latest reply: Jan 21, 2010 10:38 AM by ilvar RSS

    How can a plugin know the host version ?

    G_Soucy Community Member

      Hello,

       

      My format plugin needs to know which host version is calling it (CS2, CS3, ...) to adapt automatically (ex: CS2 does not support creating images with multi-layers). How can I get the host version from the plugin ?

       

      Up to now, I have been using  HostSupports32BitCoordinates to distinguish between before and after CS1 but I need more precision (actually, I need to distinguish hosts between before and after CS3).

       

      Thank you!

       

      Gilbert

        • 1. Re: How can a plugin know the host version ?
          ilvar Community Member

          Use Getter plugin to get the code that retreives this (or any similar type of ) information.

           

          Briefly:

          PutProperty(classProperty,keyHostVersion)

          PutEnumerated(classApplication,typeOrdinal,enumTarget);

          PSActionControl->Get()

          and then look for keyHostVersion and inside it for keyVersionMajor and keyVersionMinor

          • 2. Re: How can a plugin know the host version ?
            G_Soucy Community Member

            Thank you for the pointer. I had some compilation problems trying to use the solution you propose with my format plugin but I got what I wanted with:

             

             

             

             

            // Get the Property Suite from the parameter block

            PropertyProcs *propSuite = formatParamBlock->propertyProcs;

             

             

            if (propSuite){

                 int32 version=0;

                 propSuite->getPropertyProc(

            '8BIM', propVersion, 0, (intptr_t *)&version, nil);

                 gPhotoshopVerMaj = version >> 16;

                 gPhotoshopVerMin = version && 0x0000ffff;

            }

             

             

            Gilbert

             

             

            • 3. Re: How can a plugin know the host version ?
              ilvar Community Member

              Well, it was pseudo-code to being with