Author Topic: Edit context menu in thumbnail display?  (Read 3564 times)

0 Members and 1 Guest are viewing this topic.

Ratty

  • Member
  • **
  • Posts: 4
    • View Profile
Edit context menu in thumbnail display?
« on: 2014-06-25 14:48:49 »
I was wondering whether there is a way to change the context menu when you right-click a thumbnail in ThumbsPlus 9 Professional. I just noticed in the release notes it says that context menus can be changed but can't find how that's done.

But what I would like to do is more complicated and I'm thinking it's not possible in ThumbsPlus itself but I thought I would ask here and see if anyone can think of a tricky way to do it, maybe through a registry edit or some external program or something.

Right now we use ThumbsPlus mainly for proofing images. When a problem is found we run an appropriate ImageMagick script with the command shell. I've edited the registry to add a variety of context menus elections when an image is right-clicked in Windows Explorer. It sure would be convenient to be able to right-click the thumbnail in ThumbsPlus and run the same command rather than having to switch out to Windows Explorer.

Daan van Rooijen

  • Administrator
  • Sr. Member
  • *****
  • Posts: 946
    • View Profile
Edit context menu in thumbnail display?
« Reply #1 on: 2014-06-25 15:51:45 »
> I just noticed in the release notes it says that context menus can be changed but can't find how that's done.

To add items, try this:

    [*]First, go to Options | Customize | Programs
    [*]Add your ImageMagick command so it becomes a button in the External Programs toolbar.
    [*]Then go to Options | Customize | Menus and select the 'Files' context menu.
    [*]This context menu is now visible and you can drag and drop the ImageMagick button from the toolbar onto it.[/list]

    (keep Ctrl depressed to copy instead of move the command. Note that when the Customize dialog is open, you can also right-click on the context menu to edit various attributes).

    BTW, when you've succesfully added ImageMagick as a button to the External Programs toolbar, you can also use that to run that command on images. Just select the desired image and press the button.
    I'm volunteering as a moderator - I do not work for Cerious Software, Inc.

    Ratty

    • Member
    • **
    • Posts: 4
      • View Profile
    Edit context menu in thumbnail display?
    « Reply #2 on: 2014-06-26 11:02:59 »
    Hey, that looks really promising. I'm excited. Can't quite get it to work yet though.

    I created a test batch file with the command "echo Hello" called echo.bat. I added it through Options | Customize | Programs. Nothing was displaying in the icon option and there didn't seem to be any way to add an icon. Maybe that's why I can't get it to add a button? Anyway, when I went to Options | Customize | Menus I couldn't find a button I was supposed to drag onto the toolbar. I tried dragging Open with onto it and there is an option to Manage programs but I couldn't find any way to get it to work.

    Do I have to create an executable file and embed an icon in it? The ImageMagick scripts I call are managed through pretty complex perl scripts. Maybe I need to add the perl executable as the program? I will experiment.

    Daan van Rooijen

    • Administrator
    • Sr. Member
    • *****
    • Posts: 946
      • View Profile
    Edit context menu in thumbnail display?
    « Reply #3 on: 2014-06-26 12:16:39 »
    > I created a test batch file with the command "echo Hello" called echo.bat. I added it through Options | Customize | Programs. Nothing was displaying in the icon option and there didn't seem to be any way to add an icon. Maybe that's why I can't get it to add a button?

    Try this: re-open the Customize dialog and with that open, go to File | Open With in the main menu. This should open a submenu with the names of any external programs that you've set up, including that Echo batch file. If you see it listed there, you can drag its name onto the External Programs toolbar. Instead of an icon, the name of the batchfile will show.

    I just tried this with autoexec and it worked fine. It all feels a bit quirky though.

    When you're done experimenting, you can drag your test batch files off the menu and off the toolbar when (again) that Customize dialog is open.
    I'm volunteering as a moderator - I do not work for Cerious Software, Inc.

    Ratty

    • Member
    • **
    • Posts: 4
      • View Profile
    Edit context menu in thumbnail display?
    « Reply #4 on: 2014-06-26 13:46:47 »
    OMG that worked. I am way too excited for such a small thing. Showing this to my proofers will be like giving someone a Christmas present. And they're going to be excited too.

    I'll start experimenting now but I assume TP will pass the name of the file that is clicked on to the calling program? And the option to allow multiple files will let you select multiple thumbnails and pass all those filenames to the calling program?

    This is going to be so cool. Thank you so much!

    Arvin

    Daan van Rooijen

    • Administrator
    • Sr. Member
    • *****
    • Posts: 946
      • View Profile
    Edit context menu in thumbnail display?
    « Reply #5 on: 2014-06-26 14:15:03 »
    > I'll start experimenting now but I assume TP will pass the name of the file that is clicked on to the calling program?

    Yes, it will be put on the command line. So, for your batchfile to pass it on, I guess you'll have to use "%%1" on the command line of the program that you're calling.

    > And the option to allow multiple files will let you select multiple thumbnails and pass all those filenames to the calling program?

    Yes, but be forewarned that there was a bug which may or may not still be present.. ThumbsPlus should put all the filenames on the command line within quote signs, separated by spaces ("%1" "%2" etc), but someone reported last year that the closing quotes were being omitted. So, if it shouldn't work for you, that might well be the cause.

    ps: Note that each filetype definition also has an Editor that you can specify for that filetype. You launch that editor (which can really be any kind of program) by pressing Shift-Enter (instead of just Enter, which would open the image in the internal viewer). So, for those users that prefer to use the keyboard instead of the mouse, that might be yet another way to load the image under the cursor into a 3d party program.
    I'm volunteering as a moderator - I do not work for Cerious Software, Inc.

    Ratty

    • Member
    • **
    • Posts: 4
      • View Profile
    Edit context menu in thumbnail display?
    « Reply #6 on: 2014-06-26 16:11:54 »
    Nope, no bugs. I successfully ran my ImageMagick script on multiple files - all with spaces in their paths - without any problems.

    Also I was able to simply use %* at the end of my batch file command to pass all of the thumbsplus filename arguments on to my perl program. No enumeration or quotes needed.

    Daan van Rooijen

    • Administrator
    • Sr. Member
    • *****
    • Posts: 946
      • View Profile
    Edit context menu in thumbnail display?
    « Reply #7 on: 2014-06-27 10:53:19 »
    > Nope, no bugs. I successfully ran my ImageMagick script on multiple files - all with spaces in their paths - without any problems.

    Excellent, that has been fixed then.

    > Also I was able to simply use %* at the end of my batch file command to pass all of the thumbsplus filename arguments on to my perl program.

    Ha, I'd never heard of %*. My batch programming skills date from the DOS 3.2 days, when that kind of trickery wasn't available yet. Good to know, thanks!
    I'm volunteering as a moderator - I do not work for Cerious Software, Inc.