Skip to main content
Participant
August 2, 2008
Question

What code editor/environment are people using?

  • August 2, 2008
  • 22 replies
  • 4680 views
Not having used LUA before, I am wondering what is recommend when it comes to writing, editing and debugging LUA scripts?

Are people just using a basic text editor like Notepad or are there some better tools out there?
This topic has been closed for replies.

22 replies

DawMatt
Inspiring
March 5, 2009
@Sean,

Haven't developed a web engine before so hadn't thought about that issue.

Alternative for you - modify your new script, or write another script instead, to allow the released and development versions of a gallery to run in parallel. Either add something into the development version's galleryInfo.lrweb file and strip it out before compiling, or add something in before compiling.
e.g. the former option would look like this
Dev galleryInfo.lrweb file would include:
title = "Web Sample (Dev)",
id = "com.adobe.lightroom.wpg.templates.sdk.luawebsample.dev",

Source for compiled galleryInfo.lrweb file would include:
title = "Web Sample",
id = "com.adobe.lightroom.wpg.templates.sdk.luawebsample",

I'm guessing that would be enough to allow LR2 to distinguish between the two versions, and you to know whether you were using the released version of the one still in development. Adding a sed call to your script should easily be able to make this change for you.

This is a bit of a kludge but should work.

Matt
Sean McCormack
Community Expert
Community Expert
March 5, 2009
The Plugin manager is for Export plugins only Matt, doesn't work with Web engines. (I'm including post process and metadata stuff in Export)

Lightroom will only allow one of the plugins to work, but I'm not sure what the criteria for choosing which one it is.
Sean McCormack. Author of 'Essential Development 3'. Magazine Writer. Former Official Fuji X-Photographer.
DawMatt
Inspiring
March 5, 2009
@Sean,

I've been using NTFS junctions in Windows (think symbolic links in UNIX) to hook my source code and compiled code directories directly into the Modules directory LR2 automatically checks at startup. I only ever compile my code when I'm getting ready to release a package and do my final testing.

Advantage of this approach is LR2 already knows these two are the same plugin (they have the same identifier) so when you enable one it automatically disables the other. That way I can be merrily coding/testing away, receive a report of an error and swap to the publicly released version of the plugin to troubleshoot, then switch back to the development version once I know what the issue is. An elegant feature the Adobe crew built into the Plugin Manager.

Matt
Sean McCormack
Community Expert
Community Expert
March 5, 2009
Actually,
I could work this so that I'm not even working in Web Galleries anymore.
I could be in Docs and have the compiled version go to Web Galleries.
That way the version in Lightroom is always compiled when I test it.

Edit.. if I could read spaces in file paths in a shell script that is.. Sigh
Sean McCormack. Author of 'Essential Development 3'. Magazine Writer. Former Official Fuji X-Photographer.
Sean McCormack
Community Expert
Community Expert
March 5, 2009
Here's what I did:
__________________________

#! /bin/sh
echo
DIR="$1"
echo $DIR
cp -R $DIR $DIR".lrwebengine"
cd $DIR".lrwebengine"
luac -o galleryInfo.lrweb galleryInfo.lrweb
luac -o manifest.lrweb manifest.lrweb

_____________________________________

Bear in mind this is probably the first shell script I've written since college, but it seems to work.
I have luac in /usr/bin already..
Sean McCormack. Author of 'Essential Development 3'. Magazine Writer. Former Official Fuji X-Photographer.
Sean McCormack
Community Expert
Community Expert
March 5, 2009
Thanks Matt,
I'll peek at that soon.
Currently I just back up the script as I'm only compiling the galleryInfo.lrweb and manifest.lrweb files for Web Engines. I could actually automate this, which I hadn't considered until your note!
Sean McCormack. Author of 'Essential Development 3'. Magazine Writer. Former Official Fuji X-Photographer.
Sean McCormack
Community Expert
Community Expert
March 5, 2009
Actually after peeking through the script, I could easily modify it for .lrweb files using no extension for the dev version and the .lrwebengine extension for the compiled version.
Sean McCormack. Author of 'Essential Development 3'. Magazine Writer. Former Official Fuji X-Photographer.
DawMatt
Inspiring
March 5, 2009
Hi Sean,

I had those same concerns and in a similar vein to Kamal I've written a wrapper script to avoid the issue (see http://thephotogeek.com/download/scripts/luac-lr.cmd ). Place a shortcut to it in the parent directory for my source file and call it using a syntax similar to:
luac-lr.cmd export-backup
and it compiles code from export-backup.lrdevplugin to export-backup.lrplugin. Minimises chances for me to kill my code.

From memory you are a Mac user so you would need to convert it to bourne shell script but that wouldn't be hard.

Matt
Participating Frequently
March 4, 2009
@Sean;
I am using an ant build file that automatically calls lua copiler on my lua files. I issue:
C:/Program Files/Lua/5.1/luac.exe -o "somepath/fileName.lua" "sourcepath/fileName.lua"
That way, I am only distributing the compiled code and at the same time, I am working on my uncompiled code and neve have to worry about losing it, nor do I worry about distributing my un-compiled code.
@Dave;
I never noticed any problem when compiling my lua code and put it in my plugin folder. As you can see above, I am using the standard lua compiler. I used the compiler It seems they are not diffirent as they should not be.
Known Participant
March 4, 2009
I think this is relevant to this thread: I haven't seen info on how to compile my Lua code, how LR treats that differently if at all, etc. Do I use a stock Lua compiler or is there anything special I need to know because of the LR environment?
Sean McCormack
Community Expert
Community Expert
March 3, 2009
As I'm compiling some of my code, I'm more concerned that in a moment of weakness that I don't throw away the uncompiled code. It's happened once, but I was able to recode the changes as they were fresh, I don't want it to happen again..
Sean McCormack. Author of 'Essential Development 3'. Magazine Writer. Former Official Fuji X-Photographer.