I don’t use flatpak, and I haven’t actually opened a whole folder like this this, but I’ve debugged shellscripts, and made plenty of mistakes even in a single-liner!
First. Is the fault with the script or the command. Please try the command at a prompt…
$ flatpak run “org.darktable.Darktable” “/path/to/pictures/import”
what happens?
(You shouldn’t need those quotes unless you have spaces in your filenames)
On mac it was very easy to import directories, (something like: open -a darktable /absolute/path/to/dir), on Linux (Mint, Cinnamon, latest) things are a little different (probably because I’m a Mint newbie):
flatpak run org.darktable.Darktable --command darktable /absolute/path/to/dir
I tried in Vscode and my terminal, both throw error code 1 and display darktable’s man page instead.
There we can read:
Be careful that flatpak are running in an isolated environment (on a mac you are probably using a darktable version that is running on the main environment).
I don’t really use the flatpak version of Darktable (I use a self compiled version), but I just tried on my system, and this works:
flatpak run "org.darktable.Darktable" /home/olivier/Images
Or as Mica wrote (be careful with the location of the --command argument):
flatpak run --command=darktable "org.darktable.Darktable" /home/olivier/Images
As I already said flatpak runs in an isolated environment. If you run something like (ls replaced the darktable command):
flatpak run --command=ls "org.darktable.Darktable" /home/olivier/Images
Then you should get the list of files in the folder your specified. If not, then darktable will not find the files neither and you should look first at solving that problem.