File Types and context Menu

I'm currently using XYPlorer which is great except for one thing...it does not have duel panes ,so I've finally got frustrated enough to look for an alternative and DO has come up as the best alternative.

With XYPlorer I have used the portable file association and a custom script to give me a shortcut menu that pops up whenever I double click on a .mdb file with menus for opening in version 97 or 2007. (I run multiple versions of MS Access and it is a pain if I open in 2007 when I want ot open in an older version as the application goes through the re-install process which take 3-4 minutes.)

Reading through the documentation on File Types it looks like I might be able to configure Do to do the same but cant figure out how. I have tried setting up a file type group called "MS Access" but cant see any way to set up multiple open commands that will invoke on a double click. I have also tried setting up custom context menu item's for opening in 97/2007 and they show up, but dont actually open Access. The documentation is pretty thin in this area with little on the various commands, arguments and modifiers that show up in the drop down lists.

So can I invoke a shortcut menu on the double click?

Thanks in advance

Grant

When creating new file-type context menu items, you only need to create a file-type group if you want to save time when assigning the same items to the menus for multiple file types. If you're only trying to add one or two items to the Access files then it's probably easier to just add them directly, assuming there's only one or two file types to change (e.g. the old .MDB and newer .ACCDB).

The command you need depends on what the program expects for its arguments, but most programs let you run them with just the filename you want to open as the only argument, so you can usually use this:

"C:\Program Files (x86)\Office\Access97.exe" "%1"

(Of course, change the path to the real one on your system.)

If you add that to the context menu with type "Run an application (supported in Opus and Explorer)" and only use the %1 code (not any of the Opus-specific codes like {filepath}) then it will also work outside of Opus, as a bonus.

(%1 gets turned into the selected file's path, and is what Windows itself uses. Opus also has its own codes for inserting filenames etc. into commands, and those are usually better, but in this case it's nice to make something that works both in and out of Opus.)

That covers changing the right-click context menu, via the Context Menu tab when editing a file type. You can also modify what happens when you double-click files, but I am not sure what you mean by "set up multiple open commands that will invoke on a double click", unless you want to run both versions of Access at once every time you double-click or something?

One thing you can do is use the Events tab when editing a file type, and define separate double-click events for the left and middle mouse buttons, and for when Alt, Ctrl or Shift are held down at the same time as the double-click. (Note that those events are specific to Opus and won't affect what happens when you double-click outside of Opus.)

But defining separate events for say left double click and Alt left double click would still allow for accidentally using the wrong one which, I think, si what techworks wanted to avoid.

Assuming that I've understood corectly, I don't know if there is a better way, but perhaps the left double click event could be defined to run a some kind of script which would produce some kind of dialog asking for the version and then pass the filename to the selected version.

I realize the details are not given and that doing such a thing would require facility with a scripting language. I don't actually have knowledge of a language that would produce the dialog and get the answser.

Bob yes your correct. What I want to control is which version of access the file being double clicked on opens with, and the only way I have found to do this is with a custom dialog box that pops up when any .mdb file is double clicked. Took me a while to work this out in XYPlorer but have it working well now, and also does copy before launch and compact.

Will play a bit more with File Type

Thanks

Grant

Putting this on the context menu (as a submenu) for .mdb files would seem the obvious choice.

yeah but then I have to remember to right click! on mdb's...I have been double clicking for 20 odd yrs so that aint going to happen. Unless I can call the context menu by event in doubble click

Windows has had right-click since 1995, it's hardly a new paradigm :slight_smile:

Yes but I dont want to right click, I want a dialog box to come up when I double click offering me options for which version of the program to open the file with.

But for starters I thought I'd at least try getting the context menu to work, to understand how DOs file type works. So I've added a new group called MS Access with the extension .MDB

I've added a context menu as follows:
FileType ACTION=open C:\Program Files (x86)\Office97pro\Office\MSACCESS.EXE /NOSTARTUP "%1"

Now if I right click on my selected file I get a shortcut menu with the "Access97" option, but when I click on it, nothing happens

The above exe string was copied from my system .mdb configuration so why wont it open access 97?

Cheers

Grant

The "FileType ACTION=open" bit isn't needed there. See Leo's original reply.

Thanks, just figured that out myself. Wonder why the expression builder adds it in when it doesnt work!?

Now got context menu working for copy then open as follows:

access97 copy and open
Copy HERE AS "{file$|noext} - {date|yyyyMMdd} {file$|ext}"
"C:\Program Files (x86)\Office97pro\Office\MSACCESS.EXE" /NOSTARTUP "%1"

access2007 copy and open
Copy HERE AS "{file$|noext} - {date|yyyyMMdd} {file$|ext}"
"C:\Program Files (x86)\Microsoft Office\Office12\MSACCESS.EXE" /NOSTARTUP "%1"

So now just have to get these to be invoked on the double click instead of right click....thats the tricky part

The function editor gives you a dropdown list of commands and arguments for convenience, but it doesn't control how you use them or stop you using them in ways that don't work.

There's no way in Opus to have that sort of menu shown on double-click (except by running some sort of external program that displays it).

Hmm even if I remove the open command from the system file type for .mdb it still doesnt invoke the Dopus double click event, just gives me a windows system error saying "the file does not have a program associated with it..."

Restored my system mdb open command and and now looking at whether I can call the context menu. So tried using the FAYT command line to call >contextmenu showcmds...only problem is it only returns the windows system context menus and not the Dopus custom context menus. And I expect I'm only going to only be able to call one menu item so no better off.

I'm beginning to think jon is right and that Dopus cant handle this level of configuration like XYPlorer.

Not all programs work exactly the same way.

Just like XYPlorer doesn't support 64 bit, UAC, archives, FTP, mobile devices, etc, etc.

It seems kind of foreign to me to see a context menu pop up when dbl-clicking on something. But to each their own :slight_smile:.

I think the closest you can get to the EFFECT you want (double-clicking an MDB file to prompt you with some possible actions - though not a menu) would be to configure the MDB filetype Left double-click event to run your own "User Command". For example, call your user command "my_mdb_cmd". And add it after the copy command you're using regardless of which Access version you choose to your Left double-click event, like so:

Copy HERE AS "{file$|noext} - {date|yyyyMMdd} {file$|ext}" my_mdb_cmd
Then, in Customize->Commands... add a new User-defined Command called "my_mdb_cmd" that runs the following:

@set cmd={dlgchoose|Select Access version to open file...|Access 97="C:\Program Files (x86)\Office97pro\Office\MSACCESS.EXE"+Access 2007="C:\Program Files (x86)\Microsoft Office\Office12\MSACCESS.EXE"} {$cmd} /NOSTARTUP {f}
The result will be that the file will be copied, and you'll then be prompted with an Opus dialog that will let you choose which version of Access to open the file with. Hope that's of some use to you...

You could write a small script using VBScript or similar, and then put that on the .MDB double-click event, so that when you double-click a MDB file Opus runs the script with the file, and the script pops up a dialog (or menu, I guess) askign which version of Access you want to run.

Using the right-click menus would be much less work, though. (You could block the double-click event to make it so you don't trigger something unwanted by double-clicking without remembering to right-click instead while getting used to doing something slightly different.)

Another possibility is two toolbar buttons (or one button with different left and right click actions) that run the different versions on the selected file(s). (As with the right-click idea, you might want to block the double-click event there as well, to aid in learning to click the buttons.)

Hi! First post here.
I came here from using XYplorer too, and I'm using Directory Opus to take a look of how it is. The funcionalty of this explorer thrill me so much! I love how DO manage thumbnails.
:thumbsup:
I'm trying to do what techworks is trying to do, but for somethig more simplier: open media files.
It´s awesome for a file explorer to have a media as good as DO has, but is not a replacement for a good media player.
What I whant to do is tell to de file explorer (not to the system) that I whant to opent a file with a certain program. Example:

What it does is ,when I open a .flac (or any other file whit a given extesion), it open the file wiht the fist program on a list that I specified.
If i what to open the same file with another program, I need to open te Customize File association, like this:

DO is not XY. So, I don't expect it to work in the same way, but I expect it to work, at least (even though DO do a some things better than XY).
I don't care how, but I whant to do something like that with Directoy Opus.

To end this post:

Dude, press F10...

I hope to see excellent support on the forum. :smiley:

If you want to change what happens when you double-click a .FLAC file in Opus, without changing what happens in Explorer and on the Desktop etc., you can do that.

Go to Settings > File Types, expand the System File Types section of the list, double-click the .FLAC entry, and edit the Left Double-Click event. That event is specific to Opus, and you can make it run any Opus command and/or external program you like, passing the file as an argument (usually via {filepath} ).

That woked, but I'm having a problem.
I'm edited the Music grup to open foobar2000 whit doble-click (btw, also works with enter :open_mouth: ) using this:

"E:\Program Files\foobar2000\foobar2000.exe" /playnow "%1"

But DOpus always open .WAV with the embeded player. :angry:
I created two context menus that work fine:

"E:\Program Files\foobar2000\foobar2000.exe" /add "%1" "E:\Program Files\foobar2000\foobar2000.exe" /playnow "%1"

I don't know why dobble-click do not work with .WAV but the context menu works with the same function.

You need to turn off Preferences / File Operations / Double-click on Files / Use internal sound player for WAV files.

lol :smiley:
Thanks!