Copy link to clipboard
Copied
I'll try and keep this short. I need to set a global in my photoshop application to tell my program if the document has been opened externally, I need this for a few reasons:
1. If it's opened externally I can't have the user change the canvas size (Lock the opened doc canvas size).
2. I need to provide a call back to my calling application to tell it whenever I save (That way it can update the UI with the new saved image) OR simply assign a global on the PS application to query if the doc was opened.
I was thinking of prefixing the Document name with a Character so I can just look up the document name and know if it's been opened by an external app.
//Javascript
var documentName = "!" + ActiveDocument.Name;
//c++
if(DocumentNameContainsBash(&documentName))
EDIT: I've just realized that the doc name is read only... I can't save over it with a new name either...
But I would love to be able to check if it's been opened though some kind of document object that I could return like:
hasDocumentOpenedExternal(&document);
Is this possible in JS?
I got it:
//Set a global actionDesc
app.DoJavascript("var desc = new ActionDescriptor(); desc.putString( 0 , \"yes\"); app.putCustomOptions('mmm', desc, true);");
//Return global actionDesc
app.DoJavascript("var desc2 = app.getCustomOptions('mmm'); var s = desc2.getString(0);");
Copy link to clipboard
Copied
I got it:
//Set a global actionDesc
app.DoJavascript("var desc = new ActionDescriptor(); desc.putString( 0 , \"yes\"); app.putCustomOptions('mmm', desc, true);");
//Return global actionDesc
app.DoJavascript("var desc2 = app.getCustomOptions('mmm'); var s = desc2.getString(0);");