Note de ce sujet :
  • Moyenne : 0 (0 vote(s))
  • 1
  • 2
  • 3
  • 4
  • 5
[Résolu] LUA - Module ext_editor (Win11)
#5
(07-07-24, 07:33)jpg54 a écrit : Tu pourras nous tenir au courant si tu as trouvé une solution ?

Oui bien entendu  Wink

Alleluia, j'ai trouvé !!!!

Tout se passe dans le fichier system.lua localisé sur: C:\Users\username\AppData\Local\darktable\lua\lib\dtutils

Le code ci-dessous contient déjà mes adaptations ...

Code :
function dtutils_system.windows_command(command)
  local result = 1

  -- local fname = ds.sanitize(dt.configuration.tmp_dir .. "/run_command.bat")
  local fname = dt.configuration.tmp_dir .. "\\run_command.bat"
  local file, err = io.open(fname, "w")
 
  if file then
    dt.print_log("opened file")
    command = string.gsub(command, "%%", "%%%%") -- escape % from windows shell
    -- command = quote_windows_command(command)
    file:write(command)
    file:close()

    result = dt.control.execute(fname)
    dt.print_log("result from windows command was " .. result)

    os.remove(fname)
  else
    dt.print_error("Windows command failed: unable to create batch file")
  end

  return result
end

Voici ce que j'ai fait :

  • Code :
    -- local fname = ds.sanitize(dt.configuration.tmp_dir .. "/run_command.bat")
      local fname = dt.configuration.tmp_dir .. "\\run_command.bat"


J'ai remplacé le "/run_command.bat" par "\\run_command.bat" et j'ai supprimé la fonction ds.sanitize()
  • Code :
    -- command = quote_windows_command(command)


Mise en commentaire de la commande quote_windows_command(command) ... qui de plus contenait une faute de frappe puisqu'à l'origine il était écrit quote_windows-command(command)

Ca fonctionne maintenant  Big Grin
A force de chercher ... et merci JP pour le lien que tu m'avais envoyé, ca m'a aidé à trouver et faire mes investigations et tests  Idea
Répondre


Messages dans ce sujet
RE: LUA - Module ext_editor (Win11) - par avd - 07-07-24, 11:59

Atteindre :


Utilisateur(s) parcourant ce sujet : 7 visiteur(s)