CC Extension, how to get started
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
