Copy link to clipboard
Copied
I want to create a product that will enable exporting from photoshop to a certain custom image format.
Ideally I would like to add a menu item to the "File" menu with an option to export to my custom format, alternatively I would add the format to photoshop's existing formats in the popup menu in "Save as".
I'm trying to evaluate whether writing an extension will enable me to do this but I'm having trouble getting any sample code/tutorial or documentation from Adobe (or any other source) to actually work.
For example, following the instructions here: http://www.adobe.com/devnet/creativesuite/articles/a-short-guide-to-HTML5-extensions.html (and similarly CC_Extension_SDK.pdf)
But the extension was not loaded (AFAIK) and nothing happend.
I later understood that I need to name the extension in a reverse dns fashion and that I need not include the version in the "host" element of the manifest.xml and that the folder name to place the extension in needs to be CEP and not CEPServiceManager4
After these changes the extension was loading but I wasn't able to make any further progress. More specifically, getting the button to trigger a window opening as indicated by the tutorial
1. I've added an "openDocument" function to host/ps.js
var openDocument = function(path) {
app.open(new File(path));
}
2. I've added "./host/ps.js" as ScriptPath in the manifest
3. I've added these elements to the main html body:
<script src="js/lib/CSInterface-4.0.0.js"></script>
<script src="js/main.js"></script>
4. I've added these lines in js/main.js
var csInterface = new CSInterface();
var button = window.document.getElementById("testbutton"); button.onclick = function() {
// Call function defined in host/ps.jsx
csInterface.evalScript("addDocument()");
};
Nothing happens when I press the button, no indication of trouble is given, no messages in the console. I'm really lost here and would appreciate some help if any one can give it to me.
I'm an experienced application developer and normally work in C/C++/Objective C and I have little experiance using javascript so I expect a steep learning curve and I'm sure I am unaware of some basic stuff that is trivial to people developing in this evnrionment but I've developed plug-ins and extensions for other products in the past (including Lightroom BTW) and this experiance is leaving me feeling very stupid.
Thanks in advance to anyone who can guide me in the right direction here
Eyal
Copy link to clipboard
Copied
This is not the answer. Just a list of useful resources. But maybe some of this will help you...
HTML Panels Tips by Davide Barranca
CEP5 super mega guide (HTML5 + Node.js) by Andy Hall
HTML Panels Samples by Adobe
Extension builder plugin for Brackets and Sublime Text by David Deraedt
Slack-based community on scripting and panel development for Adobe Photoshop
Copy link to clipboard
Copied
Thanks for that! I will look into the resources you've linked to
Copy link to clipboard
Copied
I'm not speaking from personal experience, but I think you should probably look into the plugin SDK (Adobe Photoshop SDK | Adobe Developer Connection).
There appears to be a specific category of plugins for handling file formats, and you should be able to use C#/C++.
On the Extendscript side of things, while you can write binary files, it would probably be slow and cumbersome because Extendscript doesn't handily expose raw pixel data from a document as far as I know, you'd have to use workarounds like sampling individual pixels with the eyedropper tool or writing out a raw image file first.
Copy link to clipboard
Copied
Hi,
I'm currently at about 80% in the process of writing a book titled "Adobe Photoshop HTML Panels Development" (see announce here: http://www.davidebarranca.com/2015/10/announcing-photoshop-html-panels-development-book-project/) - I'll keep the blog updated in the next weeks with some news, so keep an eye on that.
Best,
Davide
---
www.davidebarranca.com
www.cs-extensions.com
Copy link to clipboard
Copied
Thanks Davide, Will keep an eye but I hope to be well inside actually writing the produce by the time it goes out.
Copy link to clipboard
Copied
The plug-in was the first thing I thought of and I had little look into that but it seems that the plug-in SDK is not well maintained (it mentions stuff that was obsolete 15 years ago) and will require a major effort just to figure how to build the samples as they are not compatible at all with the current mac development tools. In addition to that, the product I need to make needs to be mac and windows, it looks like going as a plug-in would require repeating much of the effort twice while an extension would mostly cross platform.
Copy link to clipboard
Copied
I'd also like to point out that all the HTML5/Javascript stuff is mainly for the UI.
The actual code that performs functions is for the most part Extendscript or Applescript or VBScript and you can prototype in that without having to bother with the panel stuff until you want to package it for user consumption.
And for that you should get:
The ExtenScript Toolkit : JavaScript development toolkit | Download Adobe ExtendScript Toolkit CC
PDFs and sample files: Adobe Photoshop Scripting | Adobe Developer Connection
ScriptUI PFD: ScriptUI for dummies | Peter Kahrel