LUA script manager not shown in DT

Hi,

I’d like to try some Lua scripts, but something wrong, I don’t see the script manager.
I have DT version 4.4.2, and Windows 10.

This is what I’ve done based on this video ( Installing and Enabling LUA scripting for Darktable on Windows):

  • Installed latest version of GIT from the link written in this doc: darktable lua documentation - installation
  • After installation lua folder appears in "c:\Users<username>\AppData\Local\darktable"
  • I’ve created luarc text file what contains this: require “tools/script_manager”

When I start DT I don’t see the Script manager what appears in the linked video at 6:06.
I see only “lua scripts installer” with one “execute” button at the bottom left corner, but when I click on the “execute” button, nothing happens.

What did I wrong?

Thank you for help

You should not need to edit luarc. I suggest that you remove it, and edit darktablerc to remove all lines that have ‘lua’ in them. Then see

and

Make sure that git is available through your PATH

Hi, I did what you mentioned. The only change after that is that a text appears in the “lua scripts installer” telling me to select action for exampe “install scripts”. I clicked on the “execute” button, and a “lua scripts are installed” message appears for a second.
But I still don’t see the Script manager, even if I restart DT.

Make sure that git is available through your PATH

I set manually "c:\Program Files\Git" to the PATH, but still no changes :confused:

git not being path is not the problem, as when you followed the steps of the video, you were able to run the git clone command without having to specify the full path to the executable, right?

Unfortunately, I have no idea what the problem could be. This is what I see on my Linux box, and that is exactly what I saw on the Windows machine, too (Windows showed some empty console windows while git was working). In the video below, the mouse pointer is unfortunately not visible.

Try starting darktable from the command line and see if script_manager appears.

Yes i were able to run the git clone command.

I am not familiar in DT commands, I started from command line with this command:
C:\Program Files\darktable\bin>darktable

DT started, but still no script manager :confused:

You could try adding -d lua to the command to turn on Lua debugging.
The log will be written to the file C:\Users\[username]\AppData\Local\Microsoft\Windows\INetCache\darktable\darktable-log.txt. Note that some parts of that path are hidden directories. You could attach it to a post.

2 Likes

FINALLY WORKING! :slight_smile:
I found the log file and at the end there was an error message:
LUA ERROR : cannot open C:\Users\Gál Norbert\AppData\Local\darktable\luarc: No such file or directory

So that was my fault when I created my username with letter “Á” and a space.
I changed the user folder name (in a tricky way), reinstall the GIT and now the Script manager appears in DT!! :slight_smile:

Thank you for the help :wink:

1 Like

Szívesen. :slight_smile:

For those of you who wonder if poetic justice is alive and well, I’m here to tell you that it is.

I was chasing a lua-scripts bug on windows. I normally run windows in a VM, so to make sure it wasn’t a VM problem, I decided to install darktable on windows running on hardware and test.

I fired up windows, pulled down darktable, installed it, then used script installer to install the lua-scripts. It said they were installed, but script_manager didn’t appear. Sound familiar?

So I started troubleshooting and cursing the idiot that wrote scripts installer (me) for not having any debug messages in there to tell what was going on. After an hour or so of frustration I finally figured out that when I had set up windows I used my first and last names, so that my username had a space in it. @norbre, I felt your pain.

I parked the lua-scripts issue I was working on and started working on scripts installer. It how has debugging messages that can be turned on and off. I consulted the Oracle at Delphi (or the search engine at Google) and spent hours running lua interactively and typing various versions of commands into os.execute() until I finally figured out the secret incantation to make everything work.

For those of you who want to know, to clone the lua-scripts directory (for me) the lua command is

cmd = [[""C:\Program Files\Git\cmd\git.exe" clone https;//github.com/darktable-org/lua-scripts.git "C:\Users\Bill Ferguson\AppData\Local\darktable\lua""]]
os.execute(cmd)

This should also handle special characters in usernames.

This will also trickle down to the other lua scripts that interact with the windows file system and should fix some (all?) of those errors.

3 Likes

I finally got around to fixing scripts_installer to handle spaces in usernames. It should also work with special characters. fix scripts_installer handling user names with spaces on windows by wpferguson · Pull Request #15437 · darktable-org/darktable · GitHub

5 Likes

Thank you!

1 Like

Thanks for the video. For the wrong instructions for Windows, I created a github issue to fix it

Most of the time I don’t need lua scripts in Darktable, as I’m very happy with my workflow. It seems Darktable 4.6 ships already the script manager, responsible for loading all lua scripts.

However, on my Mac I cannot use this script manager in its current shape as it is asking me to download the developer tools to install the git command - problem is, the developer package XCode, containing that git-command is about 9GB large. Also I am not interested to download XCode.

I saw that DT added “old” as a suffix to my luarc file needed to load lua scripts. Restoring the luarc file did not load any scripts and removed the script managerfrom DT’s interface instead.

What I would like to do is to manually install the scripts without the script manager because of the reasons explained above. So, my questions are:

  • What folder structure is needed to make scripts load?
  • where to add the require command to load lua scripts?

@johans3 this is all covered in the lua manual. Instead of using git, just download the tarball/zip.

https://docs.darktable.org/lua/stable/lua.scripts.manual/installation/

thanks, I already followed this guide, put my scripts in ~/.config/darktable/lua/ and added require "tools/script_manager" to ~/.config/darktable/luarc.

Does not load any scripts and removes the script manager as well.

Lets say I’ve a script ~/.config/darktable/lua/rate_group, so the luarc file looks like: require “lua/rate_group” . Tools are installed too, ~/.config/darktable/tools/.
Does not load for me.

The right answer is, tools need to be in: ~/.config/darktable/lua/ , also I don’t need to add lua as a directory in the require cmd.
Now I see the script_manager loads from the luarc, but I don’t see other scripts loaded although they are in the luarc file

Finally I got it working, DT aborts loading scripts if some script fails to load. Removed those causing problems with -d all. Nice!