🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.photoshop.scripting
Article #1891

Re: Is Dirty?

#1891
From: Barbu_Bogdan
Date: Wed, 21 Jul 2004 19:04
91 lines
2998 bytes
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!?
Technical Details
Message-ID: <3bb51c3f.0@webx.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!webx
References: <3bb51c3f.-1@webx.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Thread: f5839,63b23e4cd5286755
X-Google-Attributes: gidf5839,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: Barbu_Bogdan@adobeforums.com
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!webx
Newsgroups: adobe.photoshop.scripting
Subject: Re: Is Dirty?
Message-ID: <3bb51c3f.0@webx.la2eafNXanI>
Date: Wed, 21 Jul 2004 12:04:16 -0700
References: <3bb51c3f.-1@webx.la2eafNXanI>
Lines: 95
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit