Drag to shortcut file opening

I was wondering if Directory Opus supports creating a toolbar of application shortcuts then when your browsing you could grab any file and drag it to the application shortcut which would then open the application within the application you dragged it to.

For example I have application shortcuts for Photoshop, Sumatra PDF, and Bluebeam on a toolbar. I have my pdfs set so they open by default Sumatra but edit by default in Bluebeam. When I click+drag a file to my Photoshop Icon it opens that pdf in Photoshop.

So far all that happens is when I drag a file to a application shortcut it opens the application but don't open the file. I have seen this function in the sample application toolbar but only with the notepad shortcut; I'm not sure if that's just a happy coincidence or if i'm just missing something. I have tried copying the different codes from the sample shortcuts from the sample applications toolbar with no success.

I would like this to work with Images, zip/rar/7zip, audio, and pdf files. I can imagine this is somewhere on the resources part of the site but I just cant find it.

Thanks,
Anthony

Assuming the programs in question let you run them with a filename to open that file, simply dragging the programs to your toolbar while in Customize mode will create a button which does what you want.

If the programs need extra arguments to open files then you'll obviously need to edit the buttons and provide them as appropriate, and you may need to consult the documentation for the programs to work out how they need to be run. Most just need the filename, though, which Opus includes by default if you create the button by dragging the program to the toolbar.

I don't think the program requires any arguments, right now I have a dock type application "NeXuS" that has the same function I'm looking for. This screen shot shows on the left the properties of my CDisplay icon in the Dopus toolbar and on the right the icon properties in the NeXuS toolbar.


I'm not sure what some of the fields are intended for as I'm rather new to Directory Opus.
Again directory opus shortcut only opens the application and the the Nexus dock opens the file dragged to in in the application; the file being an image.

I have tried this also with Microsoft's Excel and Word and get the same result.

Agian, Thanks

Is that a button you made by hand or one made by dragging the program on to the toolbar?

Yes they both where dragged directly from their Respective program files directories. It didn't work so I ended up trying to copy the Function: command style from the wordpad, I just recreated it and it changed it to @async:"C:\Program Files (x86)\CDisplayEx\cdisplayex.exe" %1 which now works.

Both my Microsoft Word and Excel give me an error along the lines of could not find file so I'm assuming they require the additional arguments you where talking about. I can't say I really know where to go from here I'm not even sure where to look in the documentation of other programs.

Thanks Leo I really appreciate the help.

Anthony

Well, something seems strange from what I'm reading here, because on Opus v10.5.1.0 - if I enter customize mode and then drag the EXE program from it's program folder to a toolbar to create a button for it, Opus defines it like so automatically:

cd "C:\Program Files\CDisplayEx" @async:"C:\Program Files\CDisplayEx\cdisplayex.exe" %1
...at a minimum, the drag action for an EXE added the %1 to the end of the command line to the app, which is all that's really needed by ~most apps - including CDisplayEX.

FWIW, this all on it's own doesn't always work... @Jon / Leo / Greg, I think you probably want to change Opus behavior here to enclose the %1 in quotes (== "%1") since any files dragged to such a default button without the quotes from a location with spaces in it errors out?

@Anthony:

For your MS Office app shortcuts... if you dragged them from the Start Menu folders, you probably got a button that looks like this (f.ex. MS Excel):

cd "C:\Program Files (x86)\Microsoft Office\Office14" MSI:{90140000-0011-0000-0000-0000000FF1CE}\{538F6C89-2AD5-4006-8154-C6670774E980}
...in which case, yeah - dragging office files to something like this will NOT load the spreadsheet, it just launches Excel and loads a new empty spreadsheet. You probably want to create shortcuts to the actual program executables... and if you've already done so, then just make sure to enclose the %1 Opus added to the button in quotes - and they should work fine.

Anthony, try this button code for Excel drag and drop.


Regards, AB

[s]@AB, don't think thats going to work for anyone but you. You seem to be using a custom apppath alias that doesn't appear to be included in the default aliases...

@Locki: dragging the executables from the program folder to the toolbar to create the same sort of shortcuts that Opus created for CDisplayEX will work... just remember to enclose the %1 in quotes like has been discussed and which AB included in his example - and you won't have problems dragging files from paths with spaces in them - done.[/s]

Apologies AB... I forgot that {apppath|app.exe} references the install path to certain exe's that register their installations in Windows a certain way. So EITHER way will most likely work for you Locki and AB's method might have the upshot of STILL working if you upgrade Office to a new version and the actual path to the exe's change from Office14 to Office15 or something similar... Woohoo.

%1 is unquoted by definition and has to remain so for compatibility with Explorer.

The new version we just released has a change so that dragging programs to toolbars adds {filepath} as their argument instead of %1, so paths which need quotes will now get them with these buttons.

(Existing buttons are unaffected, so you may still need to edit them and either add quotes around the %1 or change the %1 to {filepath}.)

Thanks - though I don't see how compatibility with Explorer would be relevant in the specific case of dragging an exe to an Opus specific toolbar button :slight_smile:... Surely Explorer doesn't understand {filepath} any better than "%1"...

I jest... and I'm not calling you surely/shirley...

%1 is used in other places, some of which Explorer does see. Unless you're proposing that we make %1 mean different things in different places, which wouldn't make sense.

We could have used "%1" but then the string would always be quoted, which isn't always ideal either, and {filepath} is easier to understand than %1, so we went with that.

Thanks aussieboykie your example works fantastic and I used it as an example for Microsoft Office applications. Thanks steje the "%1" method made everything else work that didn't work with aussieboys method. Thanks everybody else who helped ahead some light on this process.

As far as when ever I was adding anything to the toolbar I never use shortcuts to make shortcuts. I've only ever dragged the actual executable files from the programs respective folders. I've got the old don't make copies of copies mentality I guess.
Applications so far...
CDisplayEx, I really have clue what the process was with this application for what ever reason it kinda picked and chose when and what with it felt like working. It was just zip, rar, cbr and 7z files full of pictures. It word after adding the "%1"
Notepad ++, just works and always had, fantastic little app.
Bluebeam, confused that crap out of me, it would work with any image but wouldn't function with pdf files, only opening the application not the file. Fixed with the "%1"
7zip, trying to open archives with 7zip would only open the directory of the file in the application not the file itself. Fixed with the "%1"

So ya I'm pretty I've finally got this stuff working.
Now I just got to get my account on the forums to show I have the pro version and I'm all set.
Only complaint was I bought the program the day before it went on sale at Bits DuJour o well.

Anthony

Running Directory Opus Pro 10.5.2.1 (4934) x64 OS 6.1 (B:7601 P:2 T:1) SP 1.0 "Service Pack 1"
Drag and drop shortcut to dbPowerAmp batch converter* does not open the target file (file name.flac for instance), just starts the BatchConverter.
However, replacing {filepath} with %1 works; "%1" does not work. Also, %1 works even if the file name has spaces.

Is this a DO bug or a DMCFileSelector.exe issue? (latest version: 14.4 dbPA).

  • Batch Converter is here: @async:"C:\Program Files (x86)\Illustrate\dBpoweramp\DMCFileSelector.exe"

Murray

Sounds like DMCFileSelector.exe cannot cope with quoted file paths, but also does not need the paths to be quoted.