Copy link to clipboard
Copied
Hello,
is there anyone grasping the basics of the <enableinfo> tags?
I'm quite stuck at page 190 of the JS Reference (what does that table mean I can't say - an example could have helped!)
I've been able to make a script which is disabled in the Filters menu unless a document is open:
<enableinfo>true</enableinfo>
I can get a single statement too, like "show if the document mode is not IndexedColor":
<enableinfo>PSHOP_ImageMode != IndexedMode</enableinfo>
And that's all. I couldn't be able to link statements (the following doesn't even make the script to show up in the menu):
<enableinfo>PSHOP_ImageMode != IndexedMode && PSHOP_ImageMode != BitmapMode</enableinfo>
Has anyone some example of use?
And - I'm probably close minded - but what the heck does it mean:
<equality> := <simpleExpression> {<equalityOperator><simpleExpression>}
Thanks in advance!
Davide
Copy link to clipboard
Copied
Hopefully I did not understand the question completely wrong.
var aDoc = app.activeDocument;
var ColourMode = aDoc.mode;
alert( ColourMode );
Copy link to clipboard
Copied
Hello,
I'm afraid I'm doing something different.
I can test the document mode - but the <enable-info> tag checks whether the script (appearing in the Filter or Automate menu) is enabled or grayed out depending on the conditional it expresses.
Thanks
Davide
Copy link to clipboard
Copied
Hi Davide,
There are a few hints at the beginning of the "JavaScript Resource" chapter, p. 189 of the "Adobe Photoshop CS6 JavaScript Scripting Reference" document, among which the last one may be the key to the problem:
• The strings must be valid XML syntax. The "&" character will not work for example. Use the && for example to get logical ‘&&’ in the enableinfo block.
HTH,
--Mikaeru
Copy link to clipboard
Copied
There are a few hints at the beginning of the "JavaScript Resource" chapter
Sometimes Photoshop scripting is kind of a treasure hunt you've to look for hints!
Thanks Mikaeru, I'll give that a try!
Davide
Find more inspiration, events, and resources on the new Adobe Community
Explore Now