IsDirty !?
IsDirty !?
Does anyone know how a image can be set as not changed (value for isDirty must be false) ? Using the Adobe SDK?
Some Code! Not working!
The keyIsDirty key is for the classDocument.
So i do something like this:
SPErr SetNotDirty()
{
PIActionReference reference = NULL;
PIActionDescriptor result = NULL;
PIActionDescriptor desc = NULL;
PIActionDescriptor document = NULL;
DescriptorTypeID runtimeEventID;
SPErr error = kSPNoError;
error = sPSActionDescriptor->Make(&desc);
if(error)
{
goto returnError;
}
error = sPSActionDescriptor->Make(&document);
if(error)
{
goto returnError;
}
error = sPSActionReference->Make(&reference);
if(error)
{
goto returnError;
}
error = sPSActionReference->PutProperty(reference, classProperty,
keyIsDirty);
if(error)
{
goto returnError;
}
error = sPSActionReference->PutEnumerated(
reference, classDocument, typeOrdinal, enumTarget );
if(error)
{
goto returnError;
}
error = sPSActionDescriptor->PutReference(desc, keyNull,
reference);
if(error)
{
goto returnError;
}
error = sPSActionDescriptor->PutBoolean(document, keyIsDirty,
false);
if(error)
{
goto returnError;
}
//Here I set the target for the action
//I also used keyTarget, keySource, keySource2, keyDocumentID
//and keyDocument - a key created by myself
error = sPSActionDescriptor->PutObject(desc, keyTo, classDocument,
document);
if(error)
{
goto returnError;
}
//Here I play the event
//I also try to create a new event called eventSetDirty
error = sPSActionControl->Play(&result, eventSet, desc,
plugInDialogSilent);
if(error)
{
goto returnError;
}
returnError:
//free all descriptors and references
if (reference != NULL) sPSActionReference->Free(reference);
if (result != NULL) sPSActionDescriptor->Free(result);
if (desc != NULL) sPSActionDescriptor->Free(desc);
return error;
}
But I get an error code -25920 which is not documented, and I don't know what
this error is!?
One of my ideas is that the keyIsDirty can be read only, so I can not set a
value for it!?
Is there any way to change this value!?
So i do something like this:
SPErr SetNotDirty()
{
PIActionReference reference = NULL;
PIActionDescriptor result = NULL;
PIActionDescriptor desc = NULL;
PIActionDescriptor document = NULL;
DescriptorTypeID runtimeEventID;
SPErr error = kSPNoError;
error = sPSActionDescriptor->Make(&desc);
if(error)
{
goto returnError;
}
error = sPSActionDescriptor->Make(&document);
if(error)
{
goto returnError;
}
error = sPSActionReference->Make(&reference);
if(error)
{
goto returnError;
}
error = sPSActionReference->PutProperty(reference, classProperty,
keyIsDirty);
if(error)
{
goto returnError;
}
error = sPSActionReference->PutEnumerated(
reference, classDocument, typeOrdinal, enumTarget );
if(error)
{
goto returnError;
}
error = sPSActionDescriptor->PutReference(desc, keyNull,
reference);
if(error)
{
goto returnError;
}
error = sPSActionDescriptor->PutBoolean(document, keyIsDirty,
false);
if(error)
{
goto returnError;
}
//Here I set the target for the action
//I also used keyTarget, keySource, keySource2, keyDocumentID
//and keyDocument - a key created by myself
error = sPSActionDescriptor->PutObject(desc, keyTo, classDocument,
document);
if(error)
{
goto returnError;
}
//Here I play the event
//I also try to create a new event called eventSetDirty
error = sPSActionControl->Play(&result, eventSet, desc,
plugInDialogSilent);
if(error)
{
goto returnError;
}
returnError:
//free all descriptors and references
if (reference != NULL) sPSActionReference->Free(reference);
if (result != NULL) sPSActionDescriptor->Free(result);
if (desc != NULL) sPSActionDescriptor->Free(desc);
return error;
}
But I get an error code -25920 which is not documented, and I don't know what
this error is!?
One of my ideas is that the keyIsDirty can be read only, so I can not set a
value for it!?
Is there any way to change this value!?