Page 1 of 1

Context menu/menu/toolbar icon to launch external program

Posted: Tue Aug 05, 2014 8:36 pm
by emdx
Is there a way of configuring XnView to launch an external program with the parameters of the currently selected files/directories?

Let’s say I want to run a specific, specialized program on several pictures. I would like to be able to select one or more files (and directories), and select a function (either via the menu, toolbar or context menu) which would be then passed via it’s command line the names of the files/directories selected.

Example: let’s say I want to run the program “C:\program files\fooBar.exe” on the files “1.jpeg”, “2.jpeg”, “8.jpeg”. I select the three files then I click on the custom “Foo Bar” function, and XnView would execute the command line “C:\program files\fooBar.exe 1.jpeg 2.jpeg 8.jpeg”.

This could be a versatile and easy way to customize XnView without having to deal with the hassle of compiling a DLL… (You could conceivably even link a batch file / bash script)…

Re: Context menu/menu/toolbar icon to launch external progra

Posted: Tue Aug 05, 2014 8:45 pm
by XnTriq
  1. Go to Tools » Options... » Toolbar » Buttons » Buttons displayed » Browser
  2. Click on Append.
  3. Enter the path to the program's EXE.
    • Command: [ C:\Progra~1\fooBar.exe ]
    • Icon file: [ C:\Progra~1\fooBar.exe ]
See also: How to "Batch" several commands via Icon in the Viewer?

Re: Context menu/menu/toolbar icon to launch external progra

Posted: Wed Aug 06, 2014 5:01 am
by emdx
Oh cool! Thanks! Just what I need.

But on XnViewMP, you have to go to Tools → Settings → Interface → Toolbar, then add a “-- COMMAND --”, then click on the “Set Label…” button to set the label, click on the “Set command…” to set the command, and “Set Icon…” to set the icon.

The only thing is that it won’t work for a whole directory… :(

Re: Context menu/menu/toolbar icon to launch external progra

Posted: Wed Aug 06, 2014 4:30 pm
by XnTriq
<-- Moderator's note: This topic has been moved from “Contribution | Customization” to “XnView MP | MP - General Support”. -->
emdx wrote:The only thing is that it won’t work for a whole directory… :(
You can tell XnView's browser to Show all files (recursive) from the context menu of a directory in the folder tree.