Skip to main content
MOMIR_ZECEVIC
Inspiring
July 17, 2013
Answered

Finding Photoshop Version From Automation Plug-in

  • July 17, 2013
  • 1 reply
  • 926 views

Does anyone knows how to determine from within automation plug-in, on which version of Photoshop plug-in is running.

Regards,

Momir Zecevic,

Ars media

This topic has been closed for replies.
Correct answer ilvar

Something along these pseudocode lines:

PutProperty(ref, classProperty, keyHostVersion);

PutEnumerated(ref, classApplication, typeOrdinal);

sPSActionControl->Get(pResult, ref);

then pResult->GetObject(keyHostVersion) followed by GetInteger(keyVersionMajor) and GetInteger(keyVersionMinor)

For copy&paste-able code run the Getter plugin and look for keyHostVersion in its output.

HTH

1 reply

ilvar
ilvarCorrect answer
Inspiring
July 17, 2013

Something along these pseudocode lines:

PutProperty(ref, classProperty, keyHostVersion);

PutEnumerated(ref, classApplication, typeOrdinal);

sPSActionControl->Get(pResult, ref);

then pResult->GetObject(keyHostVersion) followed by GetInteger(keyVersionMajor) and GetInteger(keyVersionMinor)

For copy&paste-able code run the Getter plugin and look for keyHostVersion in its output.

HTH

MOMIR_ZECEVIC
Inspiring
July 17, 2013

Thank you very much,

I know that I have seen something like that but I have forgotten where. Once again thank joy.

Regards,

Momir Zecevic

MOMIR_ZECEVIC
Inspiring
July 18, 2013

For the users eventualy having same problem here is copy/paste code:

int GetPSVersionInfo(void)

{

    int32 iVerMaj=0;

    int32 iVerMin=0;

    int32 iVerFix=0;

    SPErr error = kSPNoError;

    DescriptorTypeID runtimeClassID;

    

     PIActionDescriptor descRoot = NULL;  

     PIActionDescriptor descHostVersion = NULL;

   

     error = sPSActionDescriptor->Make(&descRoot);

     if (error) goto returnError;

    

     error = sPSActionDescriptor->Make(&descHostVersion);

     if (error) goto returnError;

    error = sPSActionControl->StringIDToTypeID("classVersion", &runtimeClassID);

    if (error) goto returnError;

       

        error = sPSActionDescriptor->GetObject(descRoot, keyHostVersion, &runtimeClassID, &descHostVersion);

         if (error) goto returnError;

       

       

        error = sPSActionDescriptor->GetInteger(descHostVersion, keyVersionMajor, &iVerMaj);

        if (error) goto returnError;

        /*

        error = sPSActionDescriptor->GetInteger(descHostVersion, keyVersionMinor, &iVerMin);

        if (error) goto returnError;

        error = sPSActionDescriptor->GetInteger(descHostVersion, keyVersionFix, &iVerFix);

        if (error) goto returnError;

        */

returnError:

    

     if (descRoot != NULL) sPSActionDescriptor->Free(descRoot);

     if (descHostVersion != NULL) sPSActionDescriptor->Free(descHostVersion);

     return iVerMaj;

}