Friday 25 June 2010

Trying to get stuff done but failing

This morning I was trying to do some work on my custom XMP File Info panel. First of all I couldn't get any panel to build properly - when I clicked on the custom panel in Photoshop or Bridge, the File Info dialog would break (only the cancel button would work).

I even went so far as following the instructions for creating a custom XMP File Info panel in the XMP File Info SDK 5.1 Programmers Guide, but still no luck. Then after about an hour (or more) of trying various things, it magically started working again.

The way I actually got it to work was by using the Flex 3.5 SDK for the project instead of Flex 4, but after doing this I changed back to Flex 4 and the panel would now display in PS/Bridge okay.

Since I was having trouble with Flash Builder, I decided to see if I could compile my old panel using Apache Ant.

After downloading ant, I tried to set it up according to the instructions at Installing ant. But I just couldn't get ant to work without specifying the full path to the ant executable.

In the end I found out what the problem was - I had set %ANT_HOME% as a User variable, whereas to be used as part of a %PATH%, it needs to be a System variable.

After lunch I tried building my panel using ant, but kept getting an error saying Could not load definitions from resource flexTasks.tasks. After some trial and error, I found that moving the line
<taskdef resource="flexTasks.tasks" classpath="${FLEX_HOME}\ant\lib\flexTasks.jar"/>
from the bottom of my build.xml file to near the top of the file (but below the line where the FLEX_HOME property is defined) fixed it.

Now when I ran ant, I got an error saying Target "build.xml" does not exist in the project. Doing some googling I found that you can run ant debug instead of ant build.xml. When running with debug I got the actual cause of the error - a typo (I had written a property as labelToolTip instead of labelTooltip). Thankfully the debug info gives the line number of the error, making it relatively easy to spot what's wrong.

I built my panel successfully using ant, but when trying to view the panel in Photoshop CS5, it was empty (and would make all other XMP File Info panels empty after viewing it). So I tried a few different things, but couldn't get anything to work.

I went back to Flash Builder and started work on modifying the default panel that it creates when you start a new XMP File Info panel project. The first thing I found is that the panel doesn't seem to work when you include an external stylesheet e.g. I had
<mx:Style source="../../../styles/DKimageXMP.css" />
The panel would build okay, but either the panel wouldn't appear in the File Info dialog in Photoshop at all, or it would be blank and break all the other panels once you'd viewed it.

The rest of the afternoon and evening I did more work on my XMP panel (not making much progress), and took some more photos.

No comments: