Possibility to add custom commands to the right-click menus for folders

Started by Carlo Didier, August 10, 2015, 03:35:18 PM

Previous topic - Next topic

Carlo Didier

I'd love to have the possibility to add custom commands to the right-click menu for folders in the "Media & Folders" tree.
Same thing for the right-click menu of images in the File Window (at least, there you have the "Windows Menu" option under the "Additional Functions").

Example: For Windows Explorer to open Bridge from the right-click menu of a folder, I just added one setting to the registry (look at the attached screen shot to see how that looks):

[HKEY_CLASSES_ROOT\Directory\shell\Bridge]
@="Browse in Adobe Bridge CC"
[HKEY_CLASSES_ROOT\Directory\shell\Bridge\command]
@="C:\\Program Files\\Adobe\\Adobe Bridge CC (64 Bit)\\Bridge.exe \"%L\""

So, if I could do the same thing in iMatch by adding a custom command like "C:\Program Files\Adobe\Adobe Bridge CC (64 Bit)\Bridge.exe ""{Folder.FullName}"", that would be wonderful.
Same thing could be done for FPV and many other applications.

Or simply add the Alt-Enter shortcut to get the Windows Menu to the Folder tree.


[attachment deleted by admin]

Ferdinand

Been asked for before.  Well, the old User Tools was asked for before.  Response was "use favourites".  While that's true, I too would find this more convenient.  Favourites is divided between categories and applications, and mostly it's in categories, so when I drag and drop to Favourites, I find it clumsy to drag to favourites, then select applications and then the application.  Right-click, however achieved, is a more intuitive approach in Windows.

Mario

And when you right click "Open" a folder, do you want to open all files in that folder? All files recursively? Or just send the folder shell item to the receiving application? Or maybe bring up a dialog asking the user what he wants to achieve? Or maybe I could dock on the shell folder menu like I already did in the context menu of files? Need to dig into this, the shell API's are complex and differ between Windows versions. User tools will never come back, Favorites are much more versatile. Even custom keyboard shortcuts, which totally avoids any kind of manual dragging and dropping like you describe.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Carlo Didier

Quote from: Mario on August 10, 2015, 06:25:59 PM
And when you right click "Open" a folder, do you want to open all files in that folder? All files recursively? Or just send the folder shell item to the receiving application? Or maybe bring up a dialog asking the user what he wants to achieve?
Nothing so complicated. I just want to specify an application and pass the full folder path as a parameter, as described above. Very simple.

Quote from: Mario on August 10, 2015, 06:25:59 PMOr maybe I could dock on the shell folder menu like I already did in the context menu of files?
That was my second proposition. Not as flexible, but still workable for those who can handle the registry settings to add what they want to the Explorer context menu.
And I just checked that for files, right-click, "Additional functions", "Windows menu ..." has a bug which prevents this solution from working. The "Windows menu" that iMatch displays does not contain everything that Windows displays in the same menu when I right-click on a file (see attachment).

[attachment deleted by admin]

Mario

Quote from: Carlo Didier on August 10, 2015, 07:27:43 PM
Nothing so complicated. I just want to specify an application and pass the full folder path as a parameter, as described above. Very simple.
But different applications may take folder names in different ways, using different flags or options. Should all that configurable? How many users do you think will have a use for that? How many applications take folders as parameters?

Could you not just write a small script and add it to the Media & Folder context menu? That's an option in the script properties, you can add scripts to the file window context menu, Tools, Media & Folders, Categories and so on...
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Mario

A script to open the selected folder in Bridge requires only one line:

Option Explicit

Sub Main
Application.ShellExecute "open", "C:\Program Files\Adobe\Adobe Bridge CS6 (64 Bit)\Bridge.exe", Application.ActiveFolder.Path
End Sub


Note: You may need to adjust the bridge folder name to match your installation. If you have the folder in the system path, "bridge.exe" alone should do as well.

When creating the script, set the option to include it in the Media & Folders context menu.



This gives you exactly what you want:





[attachment deleted by admin]
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

sinus

Super.
That tip from Mario works fine. Did not know this.
Now I can add some interesting small scripts for me.

Thanks Mario, and thanks Carlo, for the general idea. :D
Best wishes from Switzerland! :-)
Markus

Ferdinand

Brilliant, simply brilliant, and simple at that.  I have to say that I learnt so many things I should have already know from that one short post.  For those who want a script to send files to Photoshop, here is mine:

Option Explicit

Sub Main
    Dim r As File
    For Each r In Application.GetFileWindow(imfwtCurrent).SelectedFiles

    Application.ShellExecute "open", "C:\Program Files (x86)\Adobe\Adobe Photoshop CS6\Photoshop.exe", r.FileName

    Next
End Sub


I have a question, about a very minor point.  Why is the system script "Create Category from Selection" listed in the file window menu?  It's hard to remove if we don't want it there, and if we edit the .baix file then it's presumably going to reappear at the install of the next release.  Can it be changed in the next release not to appear in the menu?

Ted

Great script Mario.  I, too, have been looking for something like this.  It will be a time saver.
-----
Ted
Enjoying life one day at a time.

Carlo Didier

Hey guys! I managed to come up with nearly the same script as Mario ...
Just didn't know how easy it was to add it to the menu!
This is really all I needed, so this feature request can be closed for me.

Thanks to everyone!

Carlo Didier

Forgot to post my script.
Note that for Bridge, I had to remove the trailing "\" in the folder path to make it work!

'#Language "WWB-COM"
Option Explicit

Sub Main

Dim strPath As String

strPath = Application.ActiveFolder.Path
strPath = """" + Mid(strPath,1,Len(strPath)-1) + """"
Application.ShellExecute("","C:\Program Files\Adobe\Adobe Bridge CC (64 Bit)\Bridge.exe",strPath)

End Sub


The "Open" verb isn't necessary either as Bridge just scans the command line parameter.

Mario

1.  The script is in the file window menu because it is used as an example (in the help). I hence need it where it is. And yes, you cannot remove it.

2.  You can "Open" files in Photoshop (if this is the associated application) usually via the "Open" command in the file window context menu, or just <Ctrl>+<Return>. If you have multiple potential applications, just use <Shift>+<Alt>+<Return> (shortcut for "open with") and then pick the application you want to open the file(s) with from the icon list.

-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Ferdinand

1.  I guess I'll have to edit the .baix file after each install.

2.  Not, it's not the associated application for all file types.  This is faster and simpler and more intuitive than any of the other options, which was the reason for the OP's FR.

Mario

I mentioned <Shift>+<Alt>+<Return> because I doubt that many users know about this convenient way to launch a set of files in a specific application.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Carlo Didier

Quote from: Mario on August 12, 2015, 08:31:16 AM
I mentioned <Shift>+<Alt>+<Return> because I doubt that many users know about this convenient way to launch a set of files in a specific application.
I think you're absolutely right with that asumption.
Personally, I'm not one to use many keyboard shortcuts, mainly because I hate switching constantly between mouse and keyboard. So I mainly only use keyboard shortcuts that work with the left hand alone (like Ctrl-C, Ctrl-X and Ctrl-V) while the right hand stays on the mouse (or tablet pen).

Mario

The corresponding mouse-only: context menu in the file window > Addition Functions > Open with...

PS.: Like many developers from the dark ages I have grown a 3rd arm/hand long ago.
Looks a bit strange but it allows me to type with two hands and use mouse, all at the same time. Highly recommended.
I'm also currently making my nose grow to Pinocchio-ish dimensions. This way I can touch/swipe/type and mouse concurrently...
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Carlo Didier

Quote from: Mario on August 12, 2015, 10:27:27 AM
The corresponding mouse-only: context menu in the file window > Addition Functions > Open with...

PS.: Like many developers from the dark ages I have grown a 3rd arm/hand long ago.
Looks a bit strange but it allows me to type with two hands and use mouse, all at the same time. Highly recommended.
I'm also currently making my nose grow to Pinocchio-ish dimensions. This way I can touch/swipe/type and mouse concurrently...
:) :) :)
But I don't want to see your screen after a number of nose gestures ...  8)

ubacher

Ferdinand says:
Quote1.  I guess I'll have to edit the .baix file after each install.
referring to the Create Category from Selection Script.
( I had brought this up before - now Mario explained that this was needed because it is referred to in the help file.)
I just delete the script each time a new Imatch version appears. Easier than modifying the .baix file - It can not be modified directly (from within Imatch).