Skip to main content
April 13, 2016
Question

Photoshop SDK Hello World in 2016

  • April 13, 2016
  • 1 reply
  • 2727 views

Hello!

I'm in the process of figuring out the basics of creating Photoshop plugins using the SDK. Seems like most of the info and tutorials are somewhat dated and not so approachable. I have been able to build the Listener and Getter examples from the SDK using VS2015 and had Listener spitting out correct-seeming output. Now I would like to set up a Hello World project so that I understand the bare essentials required for a PS SDK Automation plugin. For my personal use I'm only interested in the Win version, but it seems easy enough to set things up so that Mac can be added later. I'm mostly a scripting guy with a tiny bit of C++ experience and I do not often set up Visual Studio projects. Here's what I've gathered so far:

Dir structure:

HelloWorldPlugin

HelloWorldPlugin\common

HelloWorldPlugin\win

(HelloWorldPlugin\mac)

Common files:

* PiPL (Plug-in Property List) describing what kind of plugin this is (e.g. HelloWorldPlugin\common\HelloWorldPluginPiPL.r). I stitched up a version that seems like it could work in todays world with 64-bit machines taken into account. It is a combo of code from Automation Tutorial.pdf from the SDK and some forum post somewhere. Here: HelloWorldPluginPiPL.r - Pastebin.com

* A source file with an entry point (duh :P). I'm working in C++ so this could be a function called PluginMain inside HelloWorldPlugin\common\HelloWorldPlugin.cpp. The function name is defined in the PiPL.

Windows/Visual Studio setup:

* Photoshop SDK includes in the VS Include Directories (e.g. $(PhotoshopSDK)\photoshopapi\photoshop;$(PhotoshopSDK)\samplecode\common\includes  [TODO: add rest of paths])

* Build PiPL info into the plugin (using Cnvtpipl.exe on Win), specifics unclear

* Output a DLL with .8li extension (VS Project Properties > Configuration Properties > General > Target Extension)

...aaaaand I think that's all I have for now. It's still unclear for me what are the bare essential contents of the main source file and PluginMain. If the only function of the plugin is to trigger an alert saying 'Hello World!', which \samplecode\common\includes\PI[SomethingSomething].h header files do I need to include if any? Which function do I use to actually trigger the alert!? On the Windows side, which resource files (e.g. resource.h, HelloWorldPlugin.rc) are absolutely essential and how to generate them? Have I missed something completely?

I'll keep on scanning the docs and the web for answers to my questions, but I wanted to write all this down just to clarify my thinking a bit and possibly attract tips from someone more knowledgeable.

This topic has been closed for replies.

1 reply

Participant
May 9, 2016

I too am trying to get started, and have run into the same obstacles.  I notice that the source files contain Doxygen markup.  So, I ran Doxygen on the photoshopapi folder and it generated documentation.  It is still going to be a slog to figure this stuff out - a journey I'm just getting started on - but Doxygen may help to distill the in-source comments and unravel the SDK structure.

Also - have you been able to use the VS debugger on the plugging as launched from Photoshop.  I'm working with Xcode on Mac.  In Xcode you just go to the Debug -> Attach and select Photoshop.  Then set Xcode break points and launch the plugin from Photoshop.  Bamb - you're in Xcode.  I know you can do this kind of thing with VS because I did it a couple of years ago when developing a library in C++ called from the Matlab command line.  It is a similar "attach process" procedure in VS, but I've forgotten the details.  (Matlab, however, provide a lot more API support.)  Once you have that, and some working examples, we should be able to reverse engineer the interface from the debugger.

Good luck!  (We're going to need it.)