There is program named QueueRun.exe that tries to solve problem described here Running a given number of functions at once.
Its syntaxt is:
QueueRun.exe JobList.txt THREADS=0
where JoblList.txt is text file containing commandlines (one commandline per line)
and THREADS/K is optional parameter, by default equal to number of logical CPUs.
I wonder whether there is method of dumping commandlines for all selected files to JobList.txt and then run "QueueRun.exe JobList.txt", instead executing them.
For example currently I have context menu entry "ebook-convert.exe {filepath$} {filepath$|ext=mobi}" for RTF files.
My goal is function that would create JoblList.txt containing text like:
Thanks.
I know alternatives to ebook-convert.exe (Calibre main program has its own internal queue of tasks, usable in conversion).
ebook-convert.exe is just example that may be replaced by any other CLI program.
Function I am searching for (and QueueRun.exe) would not be (is not) limited to ebook-convert.exe.
You can use an MS-DOS Batch Mode script to redirect the output from the echo command to a text file, building up the list of commands to run and then run QueueRun.exe on them. (Slightly similar example here, if you're familiar with DOS command redirection.)
Or you can use something like {filepath|filem} to have Opus generate a text file listing all the filenames, and then pass that to an external tool or script which processes the names into the format which QueueRun.exe requires.
Do you mean replacing QueueRun.exe with AutoHotkey script, or replacing only function that create JobList.txt?
First would be really interesting, second... only interesting.
@mar_d, I will comment from bottom to top.
The second example will execute either all or just one thread at time. There's completely no need to use Autohotkey as it does not introduce anything new.
The first example let's you create a list of tasks for QueueRun but I can't really see why it's better than the ms-dos batch function mentioned few posts above. (Unless you want to read all *.rtf files from one or more arbitrary (always the same) folders -- as opposed to reading all or selected files from folder currently viewed in DOpus -- then it might be easier using Autohotkey.)
They were minimalist examples written in a minute to get Konrad started with AHK scripts. It's a new way because he doesn't want to use QueueRun. You can expand them to meet any particular needs.
But this is beyond the scope of this forum, so I stop here. Take or leave it, it's up to you.
I agree with daroc.
Both scripts are not equivalent for QueueRun.exe and function that call it and provide with argument.
And first seems to only add complexity by adding AHK to business.
@mark_d
Thanks for calling attention to AHK.
But frankly speaking I had hope on simple (as promised ) scripts that would replace QueueRun.exe and its DOpus infrastructure.
For minimalist needs QueueRun.exe (or equivalent) is not necessary.
[quote="mark_d"]They were minimalist examples written in a minute to get Konrad started with AHK scripts. It's a new way because he doesn't want to use QueueRun. You can expand them to meet any particular needs.
But this is beyond the scope of this forum, so I stop here. Take or leave it, it's up to you.[/quote]
I understand that you don't want to write complete application that would work similar to QueueRun as it might be quite complicated and you would probably end up with long list of TODO list provided by users who may want to use you app.
Anyway, your previous posts ("I would automate your need with a simple AutoHotkey script.") looked like you wanted to write simple but working similar to QueueRun application (so eg. it does run only n tasks at time but doesn't have any options/parameters). This is why I commented your code snippets that they don't provide anything new to what you already can do with DOpus functions.