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

C# .NET Photoshop.Application.togglePalettes()

New Here ,
May 05, 2014 May 05, 2014

Copy link to clipboard

Copied

Hey guys,

when I'm trying to call that function Photoshop.Application.togglePalettes() it fails and the compiler says:

'Photoshop.Application' does not contain a definition for 'togglePalettes'

Everything else works just fine, this is the only but serious problem. Due to performance reasons I need to toggle the palettes off for doing some intense layer manipulations.

Is that function not available in C# / through COM ?

Any help is much appreciated.

Thanks in advance.

TOPICS
Actions and scripting

Views

1.0K

Translate

Translate

Report

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

correct answers 1 Correct answer

Enthusiast , May 06, 2014 May 06, 2014

It looks as if you are correct, it doesn't seem to be available in CS6 for me either, what does work is to send a JavaScript Call via COM, maybe you could use that?

ps.ApplicationClass app = new ps.ApplicationClass();

String RC = app.DoJavaScript("app.togglePalettes();", null, null);

ps.ApplicationClass app = new ps.ApplicationClass();

String RC = app.DoJavaScript("app.togglePalettes();", null, null);

Votes

Translate

Translate
Adobe
Community Expert ,
May 06, 2014 May 06, 2014

Copy link to clipboard

Copied

In JavaScript

togglePalettes()

or

app.togglePalettes()

suffice.

Votes

Translate

Translate

Report

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 06, 2014 May 06, 2014

Copy link to clipboard

Copied

I know that this works in JS. but I have requirements which force me to build the tools in .NET. As my question said I was wondering if this function isn't exposed via COM.

Votes

Translate

Translate

Report

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
Enthusiast ,
May 06, 2014 May 06, 2014

Copy link to clipboard

Copied

It looks as if you are correct, it doesn't seem to be available in CS6 for me either, what does work is to send a JavaScript Call via COM, maybe you could use that?

ps.ApplicationClass app = new ps.ApplicationClass();

String RC = app.DoJavaScript("app.togglePalettes();", null, null);

ps.ApplicationClass app = new ps.ApplicationClass();

String RC = app.DoJavaScript("app.togglePalettes();", null, null);

Votes

Translate

Translate

Report

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 06, 2014 May 06, 2014

Copy link to clipboard

Copied

LATEST

So then this seems to be confirmed. I also checked back with the auto-generated Python module I have found if this function is available there for COM, but it isn't.

I guess the way to do it is what you suggested. Just tried it and it works nicely. I was just curious if there's a "cleaner" way right in .NET.

Since your proposal works as expected I claim this answered.

Thanks a bunch for your help.

Votes

Translate

Translate

Report

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