Copy link to clipboard
Copied
Hello everybody
I have in my instrument the concepts of "active project". I want to make sure that if the document is not opened from the active project, then the "save" button on the panel was unaffordable.
What event in main.js do I need to track when changing active documents ?
Copy link to clipboard
Copied
If I understand you right - check, if the name and the path to the file are the correct ones.
alert(activeDocument.fullName);
could be helpful for you in this case.
Copy link to clipboard
Copied
I understand that you need to compare FullName, but the meaning of the question is different:
* Open 2 documents - 1 from drive C, the other - from drive D
* If I selected a document from the C drive in Photoshop, the button on my html-panel should be locked, if I then select the document from the D drive, then the button should be unlocked.
The question is - what event in the application should I keep track of on main.js file
Copy link to clipboard
Copied
to little informations, sorry
Provided your project file has the
name: Projectfile1.psd
and is in
folder: D:\Mainproject
if (activeDocument.fullName == "/d/Mainproject/Projectfile1.psd") { alert ("Active document is from project folder"); };
Copy link to clipboard
Copied
thanks for the line of the script, I know it. I asked what event (onLoad, onClick) and what Jquery element it is possible to put this line?
main.js file:
Copy link to clipboard
Copied
Try this:
app.notifiers.add('slct', File("/c/script.jsx"), 'Dcmn')