Can dlgchoose return value can be aliased to another string?

Here is my concern, I made a user command to calculate file checksums with fsum.

I defined this to be able to choose between CRC32 and MD5 checksum type, and select the filetypes I want the cheksum on.... The thing is, if I use CRC32 algorithm, I would like the destination file have the .sfv extension, but in case of MD5 cheksum, the extension should be .md5.

As you can see in the code below, the "format" variable is -js or -jm as it's for command line.

Is it able to alias the format variable? To be able to trigger if the file output is .sfv or .md5?

@set format = {dlgchoose|Choisir l'algorithme:|md5=-js+CRC32=-jm} {alias|home|\}PortableApps\Outils\fsum.exe {$format} *.{dlgstring|Extension(s)} >Chksum.sfv

sorry about the copy/paste....

&gt stands for >, the usual character to output the content from the command line to file

Since no one else has chimed in here I'll take a stab at this but I have to admit I have no idea what you're trying to do. However it appears to me you'd like the output file named Chksum have an extension of .sfv for CRC32 processing and .MD5 for MD5 processing. Assuming that's so, would the following work for you?

@set format = {dlgchoose|Choisir l'algorithme:|md5=-js >Chksum.md5+CRC32=-jm >Chksum.sfv} {alias|home|\}PortableApps\Outils\fsum.exe {$format}

Your command line version of FSum appears to be different to the one I found. Using "my" version, and assuming you have fsum.exe in a structure aliased as Utilities, the following buttons may do what you want..?

<?xml version="1.0"?> <button backcol="none" display="both" textcol="none" type="three_button"> <label>FS</label> <icon1>#newcommand</icon1> <button backcol="none" display="both" textcol="none"> <label>FS - File(s)</label> <icon1>#newcommand</icon1> <function type="normal"> <instruction>// MD5 selected file(s)</instruction> <instruction>@runmode hide</instruction> <instruction>@filesonly</instruction> <instruction>@nodeselect</instruction> <instruction>{alias|utilities}\fsum {f} {f|noext}.md5 /o /i:dtuhre</instruction> </function> </button> <button backcol="none" display="both" textcol="none"> <label>FS - Folder</label> <icon1>#newcommand</icon1> <function type="normal"> <instruction>// MD5 all files in folder</instruction> <instruction>@runmode hide</instruction> <instruction>@set ext = {dlgstring|Extension(s)}</instruction> <instruction>{alias|utilities}\fsum {s|noterm}\{$ext} /o /i:dtuhre /t:{dlgchoose|Recurse?|Report top level folder only=r+Single report for structure=r /r+Report per folder/subfolder=f /r}</instruction> </function> </button> </button>
Regards, AB

(If the other suggestions don't work for you) I'd probably write a bit of VBScript that you pass the filename and an argument indicating the type, and the script then runs fsum with the appropriate arguments for the type.

This script might be a good starting point.

Thanks a lot everyone for your help!

The way John proposed is working fine. I didn't thought it would because there was file types to specify normally before sending the infos to the file, but it works correctly!

AussiBoykie, I don't have the same application as you mention. The application you use is called FastSum even it's a shorter name for the command. The one I use is from Slavasoft

So in the end, I don't really have to use the @set, so here's what I use:

{alias|home|\}PortableApps\Outils\fsum.exe {dlgchoose|Choisir l'algorithme:|md5=-jm >Chksum.md5+CRC32=-js >Chksum.sfv} *.{dlgstring|Extension(s)} 

By the way, I made a mistake in my first post, -js is for CRC32 and -jm is for MD5!

About VBScripts, I didn't used any yet in DOpus, but I'll try to see the examples and make something with it! I know I'll probably need it sooner or later, and I need to be more familiar with it as I made only 2 or 3 scripts using it in the past!