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

How to use C++ to do automation in Photoshop on Windows?

New Here ,
Jul 05, 2024 Jul 05, 2024

Copy link to clipboard

Copied

I've managed to write javascript or C# to automate some tasks in photoshop. But javascript is slow, C# requires .NET runtime. I managed to get the IDL file of Photoshop which helps me use OLE automation in WIN32 API, but no document is found regarding how to use these interface methods in C++. For example, there is such "ExecuteAction" method in interface "_Application" with signature: 

[id(0x506c6179), helpstring("play an ActionManager event")]
            _ActionDescriptor* ExecuteAction(
                            [in] long EventID, 
                            [in, optional] VARIANT Descriptor, 
                            [in, optional] VARIANT DisplayDialogs);

I don't know how to pass the "VARIANT Descriptor" to it, what type should I set the VARIANT to, a dispatch interface pointer? And the "VARIANT DisplayDialogs", an integer?

Views

118

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
LEGEND ,
Jul 05, 2024 Jul 05, 2024

Copy link to clipboard

Copied

The JavaScript engine used by UXP is much faster than the old Extendscript engine.

Adobe's developer page for PS is here:

https://developer.adobe.com/photoshop/

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 ,
Jul 07, 2024 Jul 07, 2024

Copy link to clipboard

Copied

LATEST

Thanks for replying. Can I run a UXP plugin directly from command line like "Photoshop.exe xxx.jsx" or from programming code without having user click the plugin menu?

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