I think the Lua script needs to have a '.lua' extension, and the line to
bring it in should just read 'require "<filename>" ' (with no extension).

You can run Darktable with the '-d lua' switch to display Lua errors in the
terminal.

--
August Schwerdfeger
[email protected]

On Sat, Dec 14, 2019, 16:48 Jean-Luc CECCOLI <[email protected]>
wrote:

> Hello,
>
>
>
> I wanted to give it a try as my first step in learnig lua scripting.
>
> Moved my db to another place.
>
> Created a file named Import.in into ~/.config/darktable and containing the
> following lines :
>
>
>
> * local darktable = require("darktable")*
>
> * importDirs = function()*
>
> *   darktable.database.import("/media/jean-luc/NEF/20081207")*
>
> * end*
>
> * importDirs()*
>
>
>
> Created a file named luarc into ~/.config/darktable and containing the
> following line :
>
>
>
> * require "~/.config/darktable/Import.in"*
>
>
>
> Launched darktable, and... nothing. :-(
>
>
>
> What did I do wrong ?
>
>
>
> Regards,
>
>
>
> J.-Luc
>
>
>
>
>
> > Message du 13/11/19 16:43
> > De : "August Schwerdfeger" <[email protected]>
> > A : "Darktable Users List" <[email protected]>
> > Copie à :
> > Objet : Re: [darktable-user] Is there a way to bulk import many folders
> at once?
> >
> >
> For a one-off, one just has to make a Lua script with an import line for
> each folder one wants to import
> >
>
> >
> local darktable = require("darktable")
> importDirs = function()
>    darktable.database.import("/path/to/folder1")
>    darktable.database.import("/path/to/folder2")
>    ...
> end
> importDirs()
> >
>
> >
> and then place the script in the Lua script directory and add a 'require'
> statement to load it, as described in the instructions in the 'lua-scripts'
> repository [1] <https://github.com/darktable-org/lua-scripts>. The
> mass-import will then run when Darktable starts up, after which the script
> can be removed.
>
> >
> --
> August Schwerdfeger
> [email protected]
> >
>
> >
> On Wed, Nov 13, 2019 at 9:13 AM <[email protected]> wrote:
> >
>
>> On Tue, 12 Nov 2019 23:29:26 -0600
>> > August Schwerdfeger <[email protected]> wrote:
>> >
>> > >If the "import directories recursively" checkbox in the import dialog
>> > >does not fit your bill, the 'darktable.database.import' Lua function
>> > >(
>> https://www.darktable.org/lua-api/index.html#darktable_database_import)
>> > >can import a folder. If you have a text file with a list of the
>> > >folders you want to import, it should be fairly quick work to make a
>> > >Lua script that will mass-import all of them.
>> >
>> > Could you please provide some example on how to do it? I don't know
>> > lua, but I'm willing to waddle through it because that's a function
>> > that's would be helping for me.
>> >
>> > --
>> > sknahT
>> >
>> > vyS
>> >
>> ____________________________________________________________________________
>> > darktable user mailing list
>> > to unsubscribe send a mail to
>> [email protected]
>> >
>> >
>
>
> >
> ____________________________________________________________________________
> darktable user mailing list to unsubscribe send a mail to
> [email protected]
> >
>
>
> ____________________________________________________________________________
> darktable user mailing list to unsubscribe send a mail to
> [email protected]
>

____________________________________________________________________________
darktable user mailing list
to unsubscribe send a mail to [email protected]

Reply via email to