Portable Openwith Menu™


*.jpg

You probably know the situation: You need to open a file with a specific application that happens to be not the one associated to that file by Windows. What now? You may be lucky to find the application listed in the "Open With..." section of the file's Shell context menu -- but even then this is a clumsy way to work (at least one right click, then expand 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 systen, not by your needs). All these issues are elegantly tackled by the revolutionary Portable Openwith Menu (POM), introduced with XY 7.10.

The POM in action. You choose what you want to do with Johnny Cash... and you define the choices!


A single click or keyboard shortcut (Ctrl+Alt+Enter) will popup a context specific menu presenting an array of applications to open the currently selected file(s) with.

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

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

Additionally to your custom associations, the application associated by Windows (in this example ACDSee) is also shown in the menu to give you all the choices you might need. The item marked bold is the one that would be opened by a double-click.

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

Do you happen to be a Web Developer?

How would you like an OpenWith menu for HTML files like this one?
It's easy to do:

Advanced POM

For advanced users the POM has even more to offer:

Rather than just extensions, you can define any wildcarded filename patterns, including paths and individual filenames. Thus 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).
Rather than just files, you can also associate folders with applications. Tip: A single backslash will match all folders.
Rather than just executables, you can specific any kind and number of command line parameters in your Portable File Associations, which then will be used when triggering an Open operation from the POM.
Rather than just applications, you can also associate scripts with filename patterns, and thus directly run a specific script from the POM.
Within the Portable File Associations dialog, you can define friendly captions for the POM items that make it easier for you to spot the right item in a POM.
In the POM, hold Ctrl when clicking an item to go to the application instead of opening it.
Tip: Ctrl+Alt+Enter is identical to AltGr+Enter, so you can pop up the POM easily using the right hand only.

Easy Example: Append modified date

It's trivial but a great time saver for anybody who likes to append modified dates to filenames. Add the following definition to your collection of Portable File Associations (menu 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 when 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 pattern "*-<datem yyyymmdd>"). The command also works for multiple files at once.

Step-by-Step Example: Transmogrify Umlauts

Say you (or your burn software) don't like German umlauts but time and again you happen to meet one of those beasts in a filename on your system, e.g. "Köln.jpg". Now you want to quickly rename it "Koeln.jpg".

Sure, you could use menu File / Rename Special / Replace Umlauts (ä > ae ...), but this is a long way to go. Or you could assign a keyboard shortcut to this command. But waste a precious 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! This is what POM can do for you.

Step 1

Add the following definition to your collection of Portable File Associations (menu 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 on files with German umlauts. And since it's portable, you have to define it only one time to have it with you wherever you go.

Explaining the Syntax

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

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

The initial pipe character (|) ensures that this PFA will not be triggered on a double-click but is only featured in POMs. Without it, a double-click on a file "Köln.jpg" would rename it instead of opening it.
"Transmogrify Umlauts" is the caption for the menu item. If omitted then "::#131;" would be used as the caption in this case.
*[äöü]* is a wildcard pattern that matches all file items containing any of the characters "äöüÄÖÜ" in the name.
> separates the pattern from the association.
:: is the XY script marker, which 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 simply points to a native XYplorer function, namely the above mentioned File / Rename Special / Replace Umlauts (ä > ae ...). 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 (menu Tools / Customize File Associations):

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

... and you will see the command "Search IMDB for 'Mad Max'" when the current file is e.g. "Mad Max.jpg" or "Mad Max.avi". Click the command and your default browser will open IMDB's website with everything about "Mad Max".

MDB Example: Handling Parallel Access 97 and 2007

Here's a way to overrule the Windows associations for MDB files by setting up a PFA to call a script file on *.mdb files. The script file has open and compact menu options for Access 97 and 2007. It will generate the following popup menu for MDB files:

This PFA is shown in the POM of MDB files and calls the script file mdb.xys which should be located in the defaults scripts folder (XYpath\Scripts\):

|"MDB Options" *.mdb>::load mdb

The file mdb.xys may look like this:

"A97 Open" open """C:\Program Files\Office97Pro\Office\MSACCESS.EXE"" ""<curitem>"""; "A97 Compact" open """C:\Program Files\Office97Pro\Office\MSACCESS.EXE"" ""<curitem>"" /compact"; - "A2007 Open" open """C:\Program Files\Office2007Pro\Office12\MSACCESS.EXE"" ""<curitem>"""; "A2007 Compact" open """C:\Program Files\Office2007Pro\Office12\MSACCESS.EXE"" ""<curitem>"" /compact";
This page has been written 2008-04-15. The screenshots don’t reflect the current look of the application. Some of the functionality might have been changed or enhanced in the current version.