Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Hello,
I've got a similar problem. But I don't want to include native code. As in every example plugin I've found, I wanted to extract portions of my code to other scripts (just as FtpUploadTask.lua in FTP example)
But whenever I add the following line to my ExportServiceProvider I get an error:
require 'RhubarbHttpClient'
The error message looks as described in the post above:
Plug-in error log for plug-in at: /Users/krizleebear/Library/Application Support/Adobe/Lightroom/Modules/rhubarb-gallery.lrdevplugin
**** Error 1
An error occurred while attempting to run one of the plug-in’s scripts.
Could not load toolkit script: RhubarbHttpClient
**** Error 2
Could not load the post-processing filter from this plug-in.
Could not load toolkit script: RhubarbHttpClient
When I just put my code from RhubarbHttpClient.lua directly into my ExportServiceProvider, it's working.
The full code can be viewed on google-code:
Copy link to clipboard
Copied
escouten has been "replaced" by Chet Drarvik.
One thing you might try:
add the line:
return RhubarbHttpClient (and maybe make the variable local, just in case there is some issue with the global namespace).
to the end of the RhubarbHttpClient.lua script, then
instead of using require, try:
local sts, retVal = pcall( dofile, '{path}/RhubarbHttpClient.lua' )
It "should" do about the same thing, but at least it will get the whole package/require function out of the loop and put nothing but the lua compiler between the calling code and the called code. - might shed some light - dunno...
Rob
Copy link to clipboard
Copied
thanks for your fast reply!
unfortunately your suggestion didn't help.
I fiddled around a bit more and I found a working solution:
I now use require with round braces ():
require('RhubarbHttpClient');
and I changed the syntax for the definition of the function to:
RhubarbHttpClient = {}
RhubarbHttpClient.uploadImage = function(server, album, authToken, imagePath, timeoutSeconds)
...
...
end
I still don't use return -- and now it works when I access the function like this:
RhubarbHttpClient.uploadImage(server, album, authToken, pathOrMessage, timeoutSeconds)
I can't really tell the difference... should be the same for the LUA interpreter...
Thanks and best regards
Christian
Copy link to clipboard
Copied
So, were both these changes required?
As you said, I too thought both these things you mentioned were syntactic equivalents. i.e. func( param ) is equivalent to func 'param' when there is only one param, and "tbl.funcName = function" meant exactly the same as "function tbl.funcName".
Personally, I'm just curious. But also, if you could isolate and then submit a more specific bug report it may help the future.
Rob
Copy link to clipboard
Copied
no they were not.
i can't tell the difference.
in the meantime I also rolled back to the beginning.
so we learned ...
... nothing. too bad.
somehow reminds me of 'burn after reading'
Copy link to clipboard
Copied
ah. now it's getting more interesting.
I'm in the stage of including another lua script (for the ExportDialogSections) and I get the same error again.
![]()
Copy link to clipboard
Copied
"somehow reminds me of 'burn after reading'" - never saw it, but I think I can imagine based on context...
Do keep us posted ;-}
R
Copy link to clipboard
Copied
I commited the changes to the google code repository at:
http://code.google.com/p/rhubarb-gallery/source/browse/#svn/trunk/rhubarb_lightroom_plugin/rhubarb-gallery.lrdevplugin
i committed it in the stage where it's working, but if you uncomment the following line in RhubarbExportServiceProvider.lua it'll break:
--require('RhubarbExportDialogSections') --script not working if line is not commented out !!!
And isn't it ironic? The script RhubarbHttpClient that didn't work yesterday works today... perfectly.
By the way - I'm using LR 3 and I'm on Mac OSX (Snow Leopard)
Do you need more information? Should I pack the scripts and provide them as download?
Best regards
Christian
Copy link to clipboard
Copied
solution:
restarted lightroom.
WHY?
Copy link to clipboard
Copied
nothing like a good reboot sometimes... OS has bugs, Lightroom has bugs, your plugin might even have a bug ;-} Some say sunspots are also a factor, but I don't think its been proven...
Copy link to clipboard
Copied
thanks for the update. I can't see anything just skimming that would cause the strange behavior. One thing I did see though, 'content' should be declared local in RhubarbHttpClient.lua
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more