AskParam: Asks for command-line parameters via GUI dialog

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

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

A bit updated version has been released. Added parameter /s allowing to set show mode: /s0 - hidden, /s1 - normal, /s2 - maximized, /s3 - maximized.
User avatar
tbeu
Power Member
Power Member
Posts: 1336
Joined: 2003-07-04, 07:52 UTC
Location: Germany
Contact:

Post by *tbeu »

I have a new feature request: Instead of having an edit field with one suggested value what do you think of offering a new option to display a combobox with several allowed values? This would it make easy to switch between different parameter settings without retyping anything, e.g.
AskParam.exe /c"Shutdown computer after timeout" /t"600|3600|7200" /p"Shutdown timeout in seconds:" shutdown -s -t %%1
TC plugins: Autodesk 3ds Max / Inventor / Revit Preview, FileInDir, ImageMetaData (JPG Comment/EXIF/IPTC/XMP), MATLAB MAT-file Viewer, Mover, SetFolderDate, Solid Edge Preview, Zip2Zero and more
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

I think I can simply replace editbox with editable combobox and add each /t string as new item and then clear combobox after every /p. So it will be like this:

Code: Select all

AskParam.exe /c"Shutdown computer after timeout" /t"600" /t3600 /t7200 /p"Shutdown timeout in seconds:" shutdown -s -t %%1
And combobox will show 600 and its list will contain 600, 3600 and 7200.
User avatar
tbeu
Power Member
Power Member
Posts: 1336
Joined: 2003-07-04, 07:52 UTC
Location: Germany
Contact:

Post by *tbeu »

Yes, the editable combobox would be perfect.
TC plugins: Autodesk 3ds Max / Inventor / Revit Preview, FileInDir, ImageMetaData (JPG Comment/EXIF/IPTC/XMP), MATLAB MAT-file Viewer, Mover, SetFolderDate, Solid Edge Preview, Zip2Zero and more
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

New version has been released.

AskParam 1.0.3.80:
+ parameter /s{0-8} for launching process in minimized, maximized or hidden mode
+ editbox has been promoted to combobox
+ multiple /t parameters allow adding multiple combobox lines
+ parameter /u works like /t but also selects its line
+ parameter /r- prevents combobox resetting after each parameter

:D
User avatar
tbeu
Power Member
Power Member
Posts: 1336
Joined: 2003-07-04, 07:52 UTC
Location: Germany
Contact:

Post by *tbeu »

Wow, that was quick! Thank you very much!
One more suggestion: Wouldn't it be better to reset the combobox by default and use an /r- flag for the current parameter to not reset? Otherwise it is not possible to have three parameters where first two parameters offer e.g. Debug|Release (without resetting for second param) and third parameter offers Win32|x64 (without displaying Debug|Release again).
TC plugins: Autodesk 3ds Max / Inventor / Revit Preview, FileInDir, ImageMetaData (JPG Comment/EXIF/IPTC/XMP), MATLAB MAT-file Viewer, Mover, SetFolderDate, Solid Edge Preview, Zip2Zero and more
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Try this:

Code: Select all

AskParam /r- /tDebug /uRelease /pParam1: /r /pParam2: /tWin32 /tx64 /pParam3:
Maybe a bit unclear because /r[-] must be specified before /p which should clear or keep combobox contents.
Last edited by MVV on 2013-02-18, 15:19 UTC, edited 1 time in total.
User avatar
tbeu
Power Member
Power Member
Posts: 1336
Joined: 2003-07-04, 07:52 UTC
Location: Germany
Contact:

Post by *tbeu »

OK, this works indeed.
TC plugins: Autodesk 3ds Max / Inventor / Revit Preview, FileInDir, ImageMetaData (JPG Comment/EXIF/IPTC/XMP), MATLAB MAT-file Viewer, Mover, SetFolderDate, Solid Edge Preview, Zip2Zero and more
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Thank you for the nice idea. :)
As you see, it has fit into current architecture even w/o increasing file size. :D
User avatar
tbeu
Power Member
Power Member
Posts: 1336
Joined: 2003-07-04, 07:52 UTC
Location: Germany
Contact:

Post by *tbeu »

I can only enter about 60 characters into the combobox field. Can you please fix it to allow more characters. Thanks!
TC plugins: Autodesk 3ds Max / Inventor / Revit Preview, FileInDir, ImageMetaData (JPG Comment/EXIF/IPTC/XMP), MATLAB MAT-file Viewer, Mover, SetFolderDate, Solid Edge Preview, Zip2Zero and more
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Thank you, I forgot to set CBS_AUTOHSCROLL style for combobox.

Tool has been updated.
User avatar
tbeu
Power Member
Power Member
Posts: 1336
Joined: 2003-07-04, 07:52 UTC
Location: Germany
Contact:

Post by *tbeu »

Thanks for the quick fix!
TC plugins: Autodesk 3ds Max / Inventor / Revit Preview, FileInDir, ImageMetaData (JPG Comment/EXIF/IPTC/XMP), MATLAB MAT-file Viewer, Mover, SetFolderDate, Solid Edge Preview, Zip2Zero and more
User avatar
kesdoputr
Member
Member
Posts: 168
Joined: 2007-12-27, 12:38 UTC

Post by *kesdoputr »

Is AskParam have length restrict or others?

I use AskParam to run nconvert for resize pictures,cmd is here

Code: Select all

[em_nconvert_with_askparam]
cmd=%COMMANDER_PATH%\TOOLS\AskParam.exe /c"Resize by percentage" /p"Enter percentage value:" "%COMMANDER_PATH%\TOOLS\nconvert.exe"
param=-resize %%1%%%% %%1%%%% -out jpeg -c 8 -q 85 -o "%P[%%1p]_%%%%.jpg" -ratio -ctype rgb -corder inter -rtype lanczos -rflag orient -rmeta -rexifthumb %P%S
With this cmd i can select image files and type 50 to get files with 50% size

And i found that when i run this cmd on files which in deep directory
ex.C:\Documents and Settings\Administrator\Desktop\

Then i can only select about 30 files,when i select more then 30 files then i will get error message
which say i have no permission to run nconvert.exe

When i just use nconvert.exe it will works in same situation

Code: Select all

[em_nconvert_without_askparam]
cmd=%COMMANDER_PATH%\TOOLS\nconvert.exe
param=-resize 50%% 50%% -out jpeg -c 8 -q 85 -o "%P[50p]_%%.jpg" -ratio -ctype rgb -corder inter -rtype lanczos -rflag orient -rmeta -rexifthumb %P%S
So i think maybe it have some problems with askparam,thx for your reading :D
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

How many files can you select with nconvert directly? It is bad idea to pass files in command line, it would be better to use filelist instead.

Currently AskParam limits parameters to 8192 characters before expanding envvars (like cmd does).
User avatar
nsp
Power Member
Power Member
Posts: 1804
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Post by *nsp »

kesdoputr wrote:Is AskParam have length restrict or others?

I use AskParam to run nconvert for resize pictures,cmd is here

Code: Select all

[em_nconvert_with_askparam]
cmd=%COMMANDER_PATH%\TOOLS\AskParam.exe /c"Resize by percentage" /p"Enter percentage value:" "%COMMANDER_PATH%\TOOLS\nconvert.exe"
param=-resize %%1%%%% %%1%%%% -out jpeg -c 8 -q 85 -o "%P[%%1p]_%%%%.jpg" -ratio -ctype rgb -corder inter -rtype lanczos -rflag orient -rmeta -rexifthumb %P%S
With this cmd i can select image files and type 50 to get files with 50% size

And i found that when i run this cmd on files which in deep directory
ex.C:\Documents and Settings\Administrator\Desktop\

Then i can only select about 30 files,when i select more then 30 files then i will get error message
which say i have no permission to run nconvert.exe

...
As an intermediate solution instead of using [face=courier]%P%S[/face] as all file are passed in command line you could use a filelist using [face=courier]-l %L[/face]
You can also use TCBL but the call will be done file by file....
[edited -- %F if you only need names like %S or %L similar to %P%S]
Post Reply