lst2run new tool;

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: Hacker, petermad, Stefan2, white

User avatar
JackFoo
Senior Member
Senior Member
Posts: 373
Joined: 2003-02-05, 19:53 UTC
Location: ERROR

lst2run new tool;

Post by *JackFoo »

Hi, this a perliminary release aka (alpha) version, it should be stable despite being alpha i.e. non mem-leaks or major bugs; There are however many missing features that are planned.

Try it if you like, and I'll be happy to hear feadback i.e. bugs or features you would like to see.

Code: Select all

lst2run v0.1 (alpha).

USAGE:
 lst2run [-e [exe]] [-s [expression]] [-l [list.file]]
   Runs the specified [exe] on every file in [list.file] with command derived
   from the expression.

     -h          Prints this screen.
     exe         The executable to run, can be any valid runnable file.
     expression  Expression to be used as the command for [exe],containing
                 valid placeholders.
     list.file   A file containig a list of files to be run on.

Currently valid placeholders are [#f] file name, [#p] path, [#e] extension
  Given a file [c:\somedir\di1\my file.ornot]
  #p = [c:\somedir\dir1]
  #f = [my file]
  #e = [ornot]

Example of usage with TC:

Command   : C:\path\lst2run.exe
Parameters: -s "a #f.rar \"#p\#f.#e\"" -e "C:\path\rar.exe" -l %L
Will call rar to archive for every file in the list one by one.
* Note the \" before #p, this is needed to put quotes when the file/command
  might contain spaces.
Ok this is the file in base64 (remove trailing spaces), if you're having trouble getting it, post your email and I'll mail it to you; (it won't be on Maxwish's site till it becomes release)

Code: Select all

MIME-Version: 1.0
Content-Type: application/octet-stream; name="lst2run.rar"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="lst2run.rar"

UmFyIRoHADvQcwgADQAAAAAAAADUsnSAkDAAvA0AAAAiAAAC/wdKf6Z1IS8dNQsAIAAAAGxzdDJy
dW4uZXhlALBAIZIAv4hf2un/umMwAIiAE1lxsBKAcGmAgAAADROhAVkuxQy5kguSXwKRkVUwMSrl
EQNVkrYAQVbUBmqwI0SQQ2AlI+lwBP5/NU0Psy1t5ix6Z3l0xOWaF9usASfBgu5GQ7KtAk/sPJkZ
FqZhT0j0at2pOfBMyf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p
xX7+I7ou9+A6JFWoIyKjvpGd0Ojtkz02G52mMzcBe7VIAIZhE+IHlmWgMockm6j7ZC3lj6WfpNU8
HDLfJBgz0rjP72+Qfi3M0Fh/6JYwtZn90ckGFJm9NNrQlapsvbXwY5rVUzA/O5+69NxMdR/9+vWl
PTfDa7p6uOfft3EVBAPN3RFNYdVPAXqpCCdilRcKCXLrIW2ykQdz1gMLWABaTXlnYxUiC3w3IC8T
x86Y8lD7YvA0fd8OBes1JgWXZ1ZrrkFbV81F+pfyimz6PxxrYUwdrYMAAL+IZ/ap/9QA5noAgCMA
VwAAAFwAAAAC+rEq0AAAAAAdMwMAAAAAAEFDTAlVEQvkz3EdoN6FEHoGguOh6FGZolhaHQYmsVrX
kEThRDXepDMP/MypvR+n8HqMBU7VFIuLrgkFCkbUpqGDm7O3Gmtbs3wvx3y/+VZ767fCxFvjmi3y
gMQ9ewBABwA=
User avatar
JackFoo
Senior Member
Senior Member
Posts: 373
Joined: 2003-02-05, 19:53 UTC
Location: ERROR

Post by *JackFoo »

Ok, I can there is lots of interest in this tool, heh. Either way, currently worked on feature is a [#c] placeholder; it's a counter defined as follows:

Code: Select all

#c [start from]:[f1][f2]:[op1]:[op2]:[padding]

[start from] - [number] the number to start from (default = 1)
[f1][f2]     - [char][char] can be one char or two, this also defines the number
							 of operands, one/two of the following can be used
               +,-,*,/,^ (plus, minus, multiply, devide, modulo) (default = +)
[op1]        - [number] the first operand, on which the first function is used (default = 1)
[op2]        - [number] must be if [f2] was specified, mustn't be if it wasn't
[padding]    - [number 1-10] specifies the padding to be used with the result (default = 1 (no padding))
	
example:

#c - would result in counter to start from 1 and be incremented by one for each file

#c 5:+^:1:2:2 - would result in the following series: 05, 00, 01, 00, 01, 00 ... aka:
                a(1) = 5, a(N) = (a(N - 1) + 1) modulo 2; and pad to 2;
Cheers.
User avatar
Hacker
Moderator
Moderator
Posts: 13142
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

Hey,
I always get "Bad command or file name" using lst2run and something like:
Command: C:\path\lst2run.exe
Parameters: -e "c:\Programy\Xnview\nconvert.exe" -s "-out jp2 \"#p\#f.#e\"" -l %L
I tried others programs, too, always Bad command or file name. W98SE.

TIA
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
sqa_wizard
Power Member
Power Member
Posts: 3893
Joined: 2003-02-06, 11:41 UTC
Location: Germany

Post by *sqa_wizard »

Parameters: -e "c:\Programy\Xnview\nconvert.exe" -s "-out jp2 \"#p\#f.#e\"" -l %L
It seems to be one backslash too less (escaped backslash):

Parameters: -e "c:\Programy\Xnview\nconvert.exe" -s "-out jp2 \"#p\\#f.#e\"" -l %L

Try to prevent escaped doublequotes and use single quotes instead.
Parameters: -e "c:\Programy\Xnview\nconvert.exe" -s "-out jp2 '#p\\#f.#e'" -l %L

Question : is there any need to escape something ?

May try : Parameters: -e "c:\Programy\Xnview\nconvert.exe" -s "-out jp2 '#p\#f.#e'" -l %L
#5767 Personal license
User avatar
Hacker
Moderator
Moderator
Posts: 13142
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

I actually think the problem is somewhere in the code used to run the program (CreateProcess?), because the exe isn't found even when using just -s "#f". So either it's a bug in the code of lst2run or in my -e "c:\Programy\Xnview\nconvert.exe" and the other exes I tried.

But thank you for your answer nevertheless.

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
sqa_wizard
Power Member
Power Member
Posts: 3893
Joined: 2003-02-06, 11:41 UTC
Location: Germany

Post by *sqa_wizard »

OK, what about using doublequotes for %L too :

Parameters: -e "c:\Programy\Xnview\nconvert.exe" -s "-out jp2 \"#p\#f.#e\"" -l "%L"

The path to the (temporary) listfile may contain spaces ...
#5767 Personal license
User avatar
sqa_wizard
Power Member
Power Member
Posts: 3893
Joined: 2003-02-06, 11:41 UTC
Location: Germany

Post by *sqa_wizard »

I tried the same for IrfanView :)

Parameters: -s "\"#p\#f.#e\" /convert=\"#p\#f.jpg\"" -e "C:\WinTools\IrfanView\i_view32.exe" -l %L

which converts all to JPEG format without any problems.

I don't know the syntax for XnView, but may the filename must be the first entry like :

Parameters: -e "c:\Programy\Xnview\nconvert.exe" -s "\"#p\#f.#e\" -out jp2" -l "%L"
#5767 Personal license
User avatar
Hacker
Moderator
Moderator
Posts: 13142
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

what about using doublequotes for %L too
Of course I tried that, it makes no difference.

I don't know the syntax for XnView, but may the filename must be the first entry like
I am afraid I did not explain myself clearly. The EXE itself isn't found. No matter what program I try to run I get the message "Bad command or file name." If the problem was in -s then nconvert would complain about bad parameters. If it was in %L then I wouldn't get "Bad command or file name" two times (if there are two files in the list).

Thanks for your help, but I think it's either something in lst2run's code, something about me using W98SE or just some stupid mistake. :)

Thanks
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
JackFoo
Senior Member
Senior Member
Posts: 373
Joined: 2003-02-05, 19:53 UTC
Location: ERROR

Post by *JackFoo »

Hi,
I'm sorry for not answering before I've been away for a while, and am now swamped by work and studies, as if whole hell broke loose...
Any ways, I've tried your exact command line and it works here perfectly,

Parameters:-e "C:\Program Files\XnView\nconvert.exe" -s "-out jp2 \"#p\#f.#e\"" -l %L
the only change I made is the exe path, make sure it's correct, if that doesn't work than it must be something to do with win98; though I used only ANSI C and I for now use system() call rather than CreateProccess.

BTW, Program[y] is that an English _y_ or maybe other charset, I know a bit of Russion so I was thinking it might be a different charset which might b0rk the system() call.

Cheers.
User avatar
sqa_wizard
Power Member
Power Member
Posts: 3893
Joined: 2003-02-06, 11:41 UTC
Location: Germany

Post by *sqa_wizard »

JackFoo wrote:Program[y] is that an English _y_ or maybe other charset
To workaround this, you may use the old 8.3 notation.

Just drag the nconvert.exe with pressed SHIFT key to the commandline and the file incl. path shows up in 8.3 notation ...
#5767 Personal license
User avatar
Hacker
Moderator
Moderator
Posts: 13142
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

JackFoo,
Program[y] is that an English _y_ or maybe other charset
It's a totally normal y. The problem occurs with any exe I tried. I still think it must be something in the way you call the program. How about old WinExec for debugging?


sqa_wizard,
To workaround this, you may use the old 8.3 notation.
The whole path including filename is 8.3 (as can be seen in my previous posts).

Thanks
Roman
User avatar
sqa_wizard
Power Member
Power Member
Posts: 3893
Joined: 2003-02-06, 11:41 UTC
Location: Germany

Post by *sqa_wizard »

If the parameter line is clean, so what about the command part ?

I hope "C:\path\lst2run.exe" is not the real used expression ...

Is there anything that contains spaces and have to be quoted ?
#5767 Personal license
User avatar
Hacker
Moderator
Moderator
Posts: 13142
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

I hope "C:\path\lst2run.exe" is not the real used expression ...
Is there anything that contains spaces and have to be quoted ?
The expression is "c:\Programy\Totalcmd\lst2run\lst2run.exe". There is nothing that would need to be quoted. If TC wouldn't be able to find lst2run I would get a messagebox reading 'File not found!", however, I get two "Bad command or file name"s - one for each selected file.

Thanks for bearing with me
Roman
User avatar
JackFoo
Senior Member
Senior Member
Posts: 373
Joined: 2003-02-05, 19:53 UTC
Location: ERROR

Post by *JackFoo »

Hi Roman,
regrettably I have no win98 for now, I'll try finding one for test, in the meantime I've made a "debug" version, it'll write a log file [lst2run.log] that contains every line the program executes. So you'll end up with a list of commands, try running those manually and fiddle with them, it seems there is some inconsistency between the ways OS's parse quotes...

b64 follows:
[mod]Removed at JackFoo's request.

Hacker (Moderator)[/mod]
User avatar
Hacker
Moderator
Moderator
Posts: 13142
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

it seems there is some inconsistency between the ways OS's parse quotes...
It seems there really is...
""c:\Programy\XnView\nconvert.exe" -out jp2"
""c:\Programy\XnView\nconvert.exe" -out jp2"
TIA
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
Post Reply