|
|
a way the Lightroom SDK doesn't suck Wednesday, October 23 2013
The weather ratcheted another notch colder in the inevitable descent into winter. When I got up this morning, one of the items on my punch list was starting a fire. Another was doing the dishes. And another was visiting the brownhouse to take care of some bidness. And then it was back to my computer, where I had a number of things I wanted to get done before a 12:30 meeting with the guy for whom I am building that Lightroom plugin.
It was during the meeting that the problems inherent in working within Lightroom's SDK proved essentially insurmountable. The plugin I am writing is essentially a data-entry app, and needs to be driveable from the keyboard. But in Lightroom there is no way to alter the behavior of the keyboard to make it do things like expand menus or simulate the pressing of buttons. This means that my plugin couldn't be used without some reliance on a mouse. Worse perhaps even than that, hitting the ENTER (or RETURN) button causes the plugin's window to vanish. I suppose I should have been suspicious from the start about the idea of developing a data entry app designed to run inside a modal window.
Fortunately, though, we managed to find a new potential solution to our problem. Lightroom can open up a non-modal window containing a web page at the URL at specifies. Perhaps the way forward would be to continue work on the web version of the application (which I'd built about ten months ago) and have Lightroom communicate with that. I didn't think that such communication would be particularly robust; I know Lightroom can FTP stuff to a server and open a window containing a web page, but I didn't think a web page could talk to Lightroom.
But later, after the meeting, I did further research and discovered that Lightroom has more control over the web window it opens than most programs that allow for the opening of such windows. Lightroom doesn't just open a web window and call it a day (as I'd assumed it did), but it remains in communication with that page, able to read any cookies it sets. It can also receive data posted by that web page to "URLs" of the form lightroom://{your-plugin-toolkit-id}/etc. This makes for a robust two-way communication stream, meaning I can implement the entire app on the web (using all the UI candy and flexibility this affords) without having to fight my way through Lightroom's sluggish, inflexible SDK for anything besides sending and receiving data.
I'd been working on the plugin pretty much non-stop for days, but after my Wednesday meeting the I always feel like I've reached the beginning of a weekend. I celebrated the end of this week's crunch by going down to the greenhouse and applying asphalt roof patch to the wooden bits around the first floor's east facing window. My plan is to eventually cover those wooden pieces with Portland cement, thereby completing the illusion that nearly all the downstairs structure is made of solid concrete.
For linking purposes this article's URL is: http://asecular.com/blog.php?131023 feedback previous | next |