@pk5dark: Thanks a lot, now LUA is really working:slight_smile:
I can see my tags on Shutterstock after export now, but no description, i need to investigate.
You need to figure out what else need to be copied.
You can try to use the exiftool with an arguments file. An arguments file can have several options over multiple lines. This is the -@ option, which you should be able select from the modul. There is a kind of official but old sample argument file. If you select the -@ option in the modul, you will get a field for file selection. You can try this file:
@pk5dark: You are right, there was just Keywords to Tags mapping in the LUA script.
Can I add mapping for Title without using argument file? I tried to add -XMP-dc:Title > IPTC:ObjectName mapping into LUA script, but it is not working:
@pk5dark Could you please test if this “check_if_bin_exists” version works with Windows?
function check_if_bin_exists(bin)
local result
if (dt.configuration.running_os == "windows") then
local f=io.open(bin,"r")
if f~=nil then
io.close(f)
return true
else
return false
end
elseif (dt.configuration.running_os == "linux") then
result = os.execute("which " .. bin)
elseif (dt.configuration.running_os == "macos") then
result = os.execute() -- ToDo: We need something here
else
result = false
end
if (not result or result == nil) then
result = false
end
return result
end
Yes, I know I can use arg file. But I am curious if it is possible to use more arguments directly in exiftool commamnd line…
Maybe someone expeienced with exiftool itself?
exiftool “-XMP-dc:Subject > IPTC:Keywords -XMP-dc:Title > IPTC:ObjectName” image.jpg
in the cmd.exe I got the error message:
Warning: Invalid tag name ‘iptc:keywords -xmp-dc:title > iptc:objectname’
@Tobias There is a PATH variable on windows, but I guess it is not mandatory? So most windows programs which rely on external binaries have some file chooser in the preferences in such cases.
I think so, because programs can be installed in different places and there is no which command.
OT:
Currently this check_if_bin_exists() function in the lua scripts is a bit of needless. There is no script/plugin installer, so there is some knowlegde required to install the scripts and users need to read the docs and description. If somethings goes wrong users likely can check themself the error logs. Unfortunately, on windows darktable.print() is only written to the log file and not printed in the cmd.exe. dartable.error() disappears quite fast. So maybe it is not easy to find errors. Once there is a script installer check_if_bin_exists() would make more sense.
Ah, so sorry! Copied the wrong line from the terminal; I’d been trying a few things and went too far back in the history. This does work for me in Bash:
The equal sign (=) assigns the value following it to the tag; > or < copies the tag in the direction of the arrow. Using your example:
The first line will copy the contents of XMP-dc:Subject to IPTC:Keywords and copy XMP-dc:Title to IPTC:ObjectName
The second line will set IPTC:Keywords to the literal value “xmp-dc:Subject” and IPTC:ObjectName to the literal value “xmp-dc:Title” which isn’t really what I wasn’t trying to do.
@P_Cherry You have to escape the quotes with \ . Otherwise they get interpreted by LUA itself and not passed to the cmd.exe as they are. Please correct me if I am wrong here.
The outer quotes are required to save it as string. The whole command is build at the end and there I added quotes as well. So for cmd_options[1] the second quote is skipped.