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

Is it possible to get menu item checked state?

New Here ,
May 01, 2011 May 01, 2011

In a script I need to know the state of a menu items checked state - e.g. the View/Proof Colors menu item.

Is that possible? (and of cause if it is how do I do it?)

Thanks,

Jack

TOPICS
Actions and scripting
882
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 ,
May 02, 2011 May 02, 2011

View > Proof Colors seems to produce no Scripting Listener Code, so I am somewhat skeptical – others may know better, though.

What do you need it for anyway?

A workaround to ensure it is turned it off might be to invoke some random Proof Setup and then toggle Proof Colors.

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
New Here ,
May 02, 2011 May 02, 2011

The reason I need the state of "Proof Colors" is that I want to turn on/off the visibility of a layer set depending on its state.

In the layer set I would have my printing adjustments layers. This way it is very easy to compare the image with the softproof. When "Proof Colors" is turned off the printing adjustment layer set would also be turned off - displaying the image without any printing corrections.

When "Proof Colors" is turned on the printing adjustment layer set would also be turned on - displaying the softproof with printing corrections applied.

Jack

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
New Here ,
Nov 01, 2021 Nov 01, 2021

It's been over 10 years. Does anyone have an answer to this question? I have exactlty the same need (for a different menu item).

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
Mentor ,
Nov 01, 2021 Nov 01, 2021
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
New Here ,
Nov 03, 2021 Nov 03, 2021

Thank you, there's a lot of useful information there. It looks like the code will examine the items in the main menu bar?

 

In my case, the menu item I'm interested in is within the Timeline panel. I know the string id of the item ("animationShowNewLayersInFrames"), but I can't just call runMenuItem() because that will toggle the item's state. I need to know whether it's on or off before I decide whether or not to toggle it (I want it to be off).

 

Any pointers on how to get the state of that menu item?

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
Mentor ,
Nov 03, 2021 Nov 03, 2021

Photoshop does not provide access to the context menu items of the panels. That is, it will most likely fail to find out whether the timeline option you need is enabled or not.
Perhaps this can be understood indirectly (for example, by adding and removing 1 layer on the timeline and analyzing the state of the timeline or layers), however, I have never worked with this panel and have no idea what menu item animationShowNewLayersInFrames is associated with and how changing it affects the document.

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
New Here ,
Nov 03, 2021 Nov 03, 2021
LATEST

Thank you for the quick reply.

 

You would think if Photoshop allows you to manipulate a menu item, there would be a way to query its state as well. But Photoshop scripting can be frustratingly opaque at times.

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
Guide ,
May 02, 2011 May 02, 2011

AppleScript could probably tell you… but thats possibly not what you wanted…?

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