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.
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);
Copy link to clipboard
Copied
In JavaScript
togglePalettes()
or
app.togglePalettes()
suffice.
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.
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);
Copy link to clipboard
Copied
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.