Use the Action Chains plugin. It has and open with action based on this plugin, but it supports template language which can do what you want.
Make a chain withe single action (Open with action), and configure the action by choosing the path to desired program. After that choose the template option and enter the following template:
Code:
program:
priority = 'CBZ,CBR,EPUB,MOBI,AZW3';
paths = formats_paths();
for fmt in priority:
path = select(paths, fmt);
if path
then
path;
break
fi
rof
You can assign this chain to whatever keyboard shortcut you wish. It should open format based on your priority variable.
Notes:
- Change the order of the formats in the variable highlighted in blue to the order as you wish.
- The formats should be in UPPER LETTERS.
- If you don't want the chain to be available for books without these formats, you can set a condition on the chain as follows:
Code:
template = copy the same template above
datatype = text
comparison = "!="
condition value = Leave this empty
Also, check the "disable menu chain if condition is false" check box.