Copy link to clipboard
Copied
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
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
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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;
}