Usage of variables with external commands in context menu ac


For some reason, my audio ripper seems to not be working properly with my external encoder. So I was trying to solve my problem with Dopus. I've created a new file type group for .WAV files, and have added a Contect Menu action to "Encode Wav files with Monkey's Audio". The action is of type "Standard Funtion (Opus or external)" and the first command in it is:

mac.exe "%1" "%1.ape" -c5000 -v

The problems are:

[quote][b]- the resulting encoded file has a *.wav.ape name/extension because of the way the variable is passed in.

  • if multiple WAV files are selected, ALL of them are encoded at once.[/b][/quote]The questions are:

[quote][b]- is there any other use of variables in Dopus other than %1 that can be passed to a regular 'external' command like MAC.EXE that would already allow for stripping out the .wav part of the filename?

  • is there any way for multiple commands added to a context menu action can be set to:
    a) wait for the previous one to finish - like until an external command return code comes back or something?
    b) operate on only one of multiple selected files at a time?[/b][/quote]For the first, even adding a Rename command after the call to MAC doesn't seem to be working even if I first do a Select *.wav.ape because just like in the second example, all commnds run at once against all selected files... so until the encoder is done, there are no *.wav.ape files for the Rename command to operate on. For instance, if I place a *.wav.ape file in the folder before I right click on my wav file to execute the following:

mac.exe "%1" "%1.ape" -c5000 -v
Select PATTERN *.wav.ape
Rename PRESET="Wav to Ape"
Delete FILE *.wav

Only the *.wav.ape file that was already sitting there before running the commands above gets renamed... the ones that result from the actual encoding aren't touched. Some of what I'm asking about doesn't seem to be possible with Dopus, but maybe I'm just trying too hard and someone out ther can think of a different way to achieve what I want... namely:

To be able to either right click or even click a toolbar button so that a bunch of *.wav files can be encoded to *.ape files, and then delete the wav files. Any ideas?

Edit by Nudel: I changed the code boxes to quote boxes so that the text wraps instead of making the post really wide and hard to read. :slight_smile:

Try setting the action's Type to MS-DOS Batch and use {filepath$|noext} instead of %1. Not sure but I think that'll solve both your problems.

Hi there noodle-man,

That didn't quite do it... stripping the extension with the |noext qualifier makes the external command not recognize what input file you're passing... but you gave me the basic area in the Dopus help to dig a little more to get what I needed. I also didn't need to specify MS-DOS Batch Function as the function type, and here is what worked:[b]sync:"C:\Program Files\Monkey's Audio\MAC.exe" {filepath} {filepath|ext=ape} -c5000 -v Delete [/b]This way, each wav file is encoded one at a time (the sync: is actually doing this) and the Delete command deletes only the selected original wav files... after clicking delete in the 'Confirm File Delete' dialog that pops up. The 'QUIET' and 'SHIFT' switches work as expected to really get rid of the files without a confirmation dialog, but I'd prefer to see that my encoding worked before I delete the original wav files... :slight_smile:

Thanks for pointing me in the right direction dude! Some people just want answers to their questions without doing any more work for it, but I personally like the guidance to help me figure it out on my own... ya learn more this way. You da man...!