//------------------------------------------------------------------------------- // // DoIt // // Finally something interesting. You have been selected from your menu entry // or via the actions system to do your thing. Dump everything you can about // Photoshop by asking Photoshop. The output file is "Getter.log". // //------------------------------------------------------------------------------- SPErr DoIt(PSActionsPlugInMessage * /*message*/) { SPErr error = 0; char logfilename[MAX_PATH]; char* filename = (char*)"Getter.log"; error = GetFullPathToDesktop(logfilename, MAX_PATH); if (error) { logfilename[0] = '\0'; error = 0; } strncat(logfilename, filename, MAX_PATH-1); logfilename[MAX_PATH-1] = '\0'; GetApplicationInfo(logfilename); GetLayerInfo(logfilename); GetActionInfo(logfilename); GetDocumentInfo(logfilename); GetChannelInfo(logfilename); GetBackgroundInfo(logfilename); // the above routines can do their job by indexing into the open objects // path info and history info are only available to the target document // 1. remember who is the current target // 2. target the other documents by indexing // 3. switch back to the original target // (use the ID it is the most reliable way to switch back) int32 currentDocumentID = 0; int32 numDocuments = 0; int32 docCounter = 0; // we are ignoring errors so this will not give an invalid error // message when there are no documents open (void) PIUGetInfo(classDocument, keyDocumentID, ¤tDocumentID, NULL); (void) PIUGetInfo(classApplication, keyNumberOfDocuments, &numDocuments, NULL); if (numDocuments > 0) { for (docCounter = 1; docCounter <= numDocuments; docCounter++) { // this routine will error if we select the document // that is already selected, we don't care about this // as an error, keep chugging (void) PIUSelectByIndex(classDocument, docCounter); GetPathInfo(logfilename); GetHistoryInfo(logfilename); } // this routine will error if we select the document // that is already selected, we don't care about this // as an error, keep chugging (void) PIUSelectByID(classDocument, currentDocumentID); } return (error); }
int IntelligentDocInfo::GetCheckSum(void) { return GetDocumentInfo().GetDocumentChecksum(); }
CStdString IntelligentDocInfo::GetDocumentId() { return GetDocumentInfo().GetDocumentId(); }
bool IntelligentDocInfo::ChecksumChanged() { return GetDocumentInfo().GetDocumentChecksum() != m_DocumentStore.GetFileChecksum(); }
void IntelligentDocInfo::Save() { SaveIntelligentDocumentInfo(); GetDocumentInfo().SetDocumentChecksum(m_DocumentStore.GetFileChecksum()); SaveIntelligentDataFile(); }