AskParam: Asks for command-line parameters via GUI dialog
Moderators: Hacker, petermad, Stefan2, white
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
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
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:
And combobox will show 600 and its list will contain 600, 3600 and 7200.
Code: Select all
AskParam.exe /c"Shutdown computer after timeout" /t"600" /t3600 /t7200 /p"Shutdown timeout in seconds:" shutdown -s -t %%1
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
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

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

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).
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
Try this:
Maybe a bit unclear because /r[-] must be specified before /p which should clear or keep combobox contents.
Code: Select all
AskParam /r- /tDebug /uRelease /pParam1: /r /pParam2: /tWin32 /tx64 /pParam3:
Last edited by MVV on 2013-02-18, 15:19 UTC, edited 1 time in total.
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
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
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
Is AskParam have length restrict or others?
I use AskParam to run nconvert for resize pictures,cmd is here
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
So i think maybe it have some problems with askparam,thx for your reading 
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
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

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).
Currently AskParam limits parameters to 8192 characters before expanding envvars (like cmd does).
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]kesdoputr wrote:Is AskParam have length restrict or others?
I use AskParam to run nconvert for resize pictures,cmd is here
With this cmd i can select image files and type 50 to get files with 50% sizeCode: 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
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
...
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]