Portable Openwith Menu™


You probably know the situation: You need to open a file with a particular application that happens to be not the one that Windows has associated with that file. What do you do?

You might be lucky enough to find the application listed in the "Open With..." section of the file's shell context menu -- but even then, it's a cumbersome way to work (at least a right click, then expanding a submenu, then a left click), it lacks configurability (what if you need command-line parameters?), and it's not portable (away from home, the shell's "Open With..." is defined by the host system, not by your needs).

All these problems are elegantly solved by the Portable Openwith Menu (POM).

The POM in action. You choose what you want to do with the selected file(s) from the options you defined.

A single click or shortcut (Ctrl+Alt+Enter) opens a context-sensitive menu that presents a set of applications to open the currently selected file(s) or scripts to apply to the file(s).

The specific contents of this menu depend on (A) the currently selected file(s) and (B) your Portable File Associations (PFA) setup, so it is portable and easy to manage.

The menu above is generated from the definitions below. It's displayed when you press Ctrl+Alt+Enter on a JPG, PNG, or GIF file.

In addition to your custom shortcuts, the application associated by Windows (in this example, Windows Photo Viewer) is also displayed in the menu to give you all the choices you might need. The item in bold is the one that would open if you double-clicked on the file.

Definitions of the Custom File Associations.

For mouse users, the POM is just a click away: (toolbar button).

Advanced POM

For advanced users, the POM has even more to offer:

Instead of just extensions, you can define any wildcarded filename pattern, including paths and individual filenames. So you can have specific context menus for all Readme.txt files, or for all items in C:\Windows\, or for all items containing German umlauts (pattern: *[äöü]*, see also below).
Instead of just files, you can also associate folders with applications. Tip: A single backslash matches all folders.
Rather than just executables, you can specify any type and number of command line parameters in your Portable File Associations, which will then be used when triggering an Open operation from the POM.
Rather than just applications, you can also associate scripts with filename patterns and run a specific script directly from the POM.
In the Portable File Associations dialog, you can define friendly captions for the POM items, making it easier to identify the correct item in a POM.
In the POM, hold down Ctrl when clicking on an item to go to the application instead of opening it.
Tip: Ctrl+Alt+Enter is identical to AltGr+Enter, so you can easily open the POM with your right hand only.

Easy Example: Append modified date

This is trivial, but a great time saver for anyone who likes to append modified dates to file names. Add the following definition to your collection of portable file associations (Tools | Customize File Associations):

|"Append modified date" \;*>::rename "b", "*-<datem yyyymmdd>"

... and you will see the command "Append modified date" in the POM for each folder and file. Now if you select a file, say "Koeln.jpg", open the POM and select "Append modified date", it will be renamed to "Koeln-20080728.jpg" (as defined in the "*-<datem yyyymmdd>" pattern). The command also works for multiple files at once.


Step-by-Step Example: Transmogrify Umlauts

Let's say you (or your software) don't like German umlauts, but from time to time you come across one of these beasts in a filename on your system, e.g. "Köln.jpg". Now you want to quickly rename it to "Koeln.jpg".

Sure, you could use File | Rename Special | Convert to ASCII, but that is a long way to go. Or you could assign a shortcut to this command. But why waste a valuable shortcut on this rarely used function and have to remember it?

Ideally, you'd have a command that only shows up when you need it! That's what POM can do for you.

Step 1

Add the following definition to your collection of Portable File Associations (Tools | Customize File Associations...): |"Transmogrify Umlauts" *[äöü]*>::#131;

Step 2

Well, that's it! Select a file with German umlauts in the name and open the POM (via Toolbar , or via Ctrl+Alt+Enter). This is what you'll get now:

If you select "Transmogrify Umlauts", a file named Köln.jpg will be renamed to Koeln.jpg. And remember the best part: You get this menu item only for files with German umlauts. And because it's portable, you only have to define it once to take it with you wherever you go.

Explaining the Syntax

Finally, let's take apart the Portable File Association (PFA) definition we've been using:

|"Transmogrify Umlauts" *[äöü]*>::#131;

The initial pipe character (|) ensures that this PFA is not fired on a double-click, but only in POMs. Without it, a double-click on a file named "Köln.jpg" would rename it instead of opening it.
"Transmogrify Umlauts" is the caption for the menu item. If omitted, "::#131;" would be used as the caption in this case.
*[äöü]* is a wildcard pattern that matches all file items that contain any of the characters "äöüÄÖÜ" in their names.
> separates the pattern from the association.
:: is the XYplorer script marker that qualifies the associated item as a script. Without this marker, the associated item is expected to be the path to an executable application.
#131; is the associated script. In this case the script is just a numeric identifier, a command ID, that points to a native XYplorer function, namely the above mentioned File | Rename Special | Convert to ASCII. In XYplorer, each function has a unique ID that can be easily retrieved via the Customize Keyboard Shortcuts dialog:

Cineast Example: What's that movie?

Here's a wonderful little gimmick for movie fans. Add the following definition to your collection of Portable File Associations (Tools | Customize File Associations):

|"Search IMDB for '<curbase>'" *>::Open("https://www.imdb.com/find?s=tt&q=<curbase>");

... and you will see the command "Search IMDB for 'Mad Max'" if the current file is, for example, "Mad Max.jpg" or "Mad Max.avi". Click on the command and your default browser will open the IMDB website with everything about "Mad Max".

This page was last updated on 2024-01-09. Screenshots do not necessarily reflect the current look and feel of the application. Some of the functionality may have been changed or enhanced in the current version.