Page 1 of 1

[solved] cannot add run to a script

Posted: 13 Jun 2026 17:10
by lian00
Hello, I use a script in conjunction with NConvert to add a watermark to an image file. It works without any problem. I tried to add a run command asking the script to launch a program, but it won’t work at all. The script is located in a button in the toolbar, and if I click the button, I see the code and the script won’t work.

The original script

Code: Select all

foreach($file, "<get SelectedItemsPathNames |>") {
  $rand = rand(1,5);
  $nomfichier = "E:\truc\essai-cadre-"."$rand".".png";
  wait 1000;
    runret("""C:\Program Files\nconvert\nconvert.exe"" -resize longest 500 -quiet -wmflag center -wmfile"." $nomfichier"." -D -out jpeg -o E:\truc\alternative\%-alter.jpg"." $file""");
        wait 1000;
   }
   end confirm ("Allez à Alternative ? !!PENSER à uploader l'image!!") == 0;
          goto "E:\truc\alternative";
I try to add the line - and tested in different places of the code

Code: Select all

run "C:\Program Files (x86)\FTP Rush\FTPRush.exe";

Re: cannot add run to a script

Posted: 13 Jun 2026 17:55
by highend
if I click the button, I see the code and the script won’t work
Then it isn't indented correctly...

Re: cannot add run to a script

Posted: 13 Jun 2026 18:43
by lian00
highend wrote: 13 Jun 2026 17:55
if I click the button, I see the code and the script won’t work
Then it isn't indented correctly...
Sorry, but I don’t know exactly what you mean.

Re: cannot add run to a script

Posted: 13 Jun 2026 18:50
by highend
If you see the code of the script instead of it being executed, the script is not indented correctly...

rtfm "idh_scripting.htm#idh_scripting_multi";

Re: cannot add run to a script

Posted: 13 Jun 2026 21:56
by lian00
OK, thanks. I have another error now, but I should solved it by myself.