Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

enable-info grammar

Advocate ,
Mar 19, 2013 Mar 19, 2013

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

TOPICS
Actions and scripting
937
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Community Expert ,
Mar 19, 2013 Mar 19, 2013

Hopefully I did not understand the question completely wrong.

var aDoc = app.activeDocument;

var ColourMode = aDoc.mode;

alert( ColourMode );

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Mar 20, 2013 Mar 20, 2013

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Mar 20, 2013 Mar 20, 2013

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Mar 20, 2013 Mar 20, 2013
LATEST

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines