Tagger3 for DOpus12

29.11.2016: Update to v3.2:

  • Tagger now follows the selection in the viewer in realtime with a 300ms delay.
  • Tagger and it's parent viewer window are now working correctly with FlatView.
  • Some changes to avoid script errors when a bad button code with the argument VIEWER was used. For example if you use Tagger VIEWER from a button in a lister toolbar without starting Tagger "embedded" (enclosed by square brackets) or without starting a viewer instance first you'll no longer get a script error. If a viewer window exists Tagger will close that window and behave as if the argument VIEWER wasn't given.

Tested and it works! o) The Tagger GUI steals the focus from the viewer though, is that intentional?
That way you can only skip to next/prev via the viewer once, after that all input goes to the Tagger GUI.
I guess that can be quite handy for specific situations, for others it's not. Let me know what you think. o)

Thanks! o)

I'm glad Tagger no longer throws an error for you although it's still the same Show command. I only changed the order of arguments.

Basically it's intended that you navigate through files with the Tagger GUI and navigating with the Viewer is just an additional goodie. :slight_smile:
The focus change is not intentional. The OnViewerEvent function creates a script variable that the timer event inside the dialog message loop detects to update the information. This forces the dialog to the foreground.
Unfortunately there's currently no good way to toggle the focus back to the viewer. The only VIEWERCMD argument I found that forces the focus to the viewer is Show VIEWERCMD=cmdbar which displays a FAYT-style command bar at the bottom of the viewer. A too dirty workaround to integrate it.
I really wish there would be an VIEWERCMD=foreground argument. :wink: => feature request

However, I'm quite happy with the focus change. It works great with mouse wheel or mouse click. For keyboard it's also fine if you want to watch one file after the other (how abr does) and immediately apply Tags or comment to them without having to toggle the focus manually somehow.

@tbone:
Are you aware that you can change the hotkeys for the next/prev buttons of the dialog in the script configuration? Currently they are alt++ / alt+NUM+ for next and alt+- /alt+NUM- for previous. I'll change the defaults with the next update so they can be pressed with one hand and it's more like the viewer hotkeys: alt+SPACE for next and ctrl+SPACE for previous. I think it doesn't make a big difference with these keys if you navigate with the viewer or with Tagger.

Are you sure? It looks like the line dlg.Control("editrange").value = i+1 is the cause for the focus to move back to the Tagger GUI.
Maybe there is a way to prevent this? Jon/Leo do you have any opinion on this? Is the focus pull back required for something else to work?

Yes, I think. I'm just thinking that trying to duplicate the viewer hotkeys to navigate from the Tagger GUI makes less sense for me, as I'd loose all the other viewer functionality like zoom/delete/reset/crop and so on. I'd prefer if the Tagger GUI sits silently above the viewer, updating itself without interfering while I seek through the images. If I like to move over to tag/edit some image, I'd give it focus and do so, but until then I expect it to be passive.

Other users probably think different about the focus thing and it might be perfect for them. o) I might not be the Tagger power user but this talking gives me some insight on the new scripting possibilities as well, so it's very welcome and interesting, whatever the fnial outcome is! o)

This line just initializes the update process. The event editchange in range input calls the function EditRange (and CheckSource) which calls the function UpdateDlg. The focus change seems to happen somewhere in UpdateDlg. I thought it's line 643 but it isn't. So applying changes to the dialog controls (name field, group control, listview, rating input) is most probably the reason for the focus change. I'll look into this. Would be nice to know how to toggle the focus from the viewer to the dialog because there's currently no documented way to do this with a single command.

It's line 768 that's steeling the focus. Comment it out and you should be fine.

Lines 767-769 disabled and the GUI's still taking focus here, mhh? o)

        ' Update Controls
        'dlg.Control("static1").label = GetString("various",lang) & cmd.sourcetab.selected.count & "/" & all & ")"
        'dlg.Control("static1").fg("220,51,39")

Ups, sorry I should always look up the lines in the original uploaded version. It's line 775-778. I'll move that lines to other places where it won't steel the focus.

Which hotkeys (of 64) do you think should be also available from the Tagger GUI? It's easy to make the hotkeys of the viewer also working from Tagger because except of "Image convert" they're all VIEWERCMD commands. The hotkeys with modifier would be the same and the single character keys needed for text input could work with the modifier alt or ctrl.

Aha! Jetzt geht es! o)
Uhm, I meant, now it works as I like it, no more focus stealing when using the viewer to skip images, very good! o) Not sure about the hotkeys, what I use most often is pageup/down, fit to screen, 1:1, show information overlay, crop, save (as), delete, fullscreen toggle and mark.

Thanks! o)

What was causing the focus issue?

Setting the focus to the main edit control:

    If dlg.Control("editrange").focus = False Then
        dlg.Control("editmain").focus = True
        dlg.Control("editmain").SelectRange len(dlg.Control("editmain").value),-1
    End If

If I'm right it was this line (an edit control):

dlg.Control("editmain").focus = TrueJust from looking at it, I would not expect the whole GUI to get the focus, but..

If you give focus to a control the window it's in is activated automatically, that's just how Windows works.

Okay! o)

09.12.2016: Update to v3.3:[ul][li]Bugfix: Tagger is no longer steeling the focus when you change the currently displayed image from the viewer window.[/li][li]Nearly all default hotkeys of the standalone viewer are also available from the Tagger GUI now. Several hotkeys needed to be modified with an additional modifier key. Download the file "TaggerHotkeys.txt" from the first post for a complete list of supported hotkeys.[/li][li]Added "Myhotkey" and "MyCommand" to the script configuration. You can specify your own hotkey that executes a user defined command with these options.[/li][li]To toggle the focus from the viewer to the Tagger GUI you can now create a new viewer hotkey that creates a global variable named "TaggerFocus". Tagger will detect this variable and move the focus to it's main input field. The command for the viewer hotkey is: @set glob!:TaggerFocus = True[/li][li]Updated the first post to describe the new features. Below "Other features" there's also a description how to create a hotkey that toggles the focus between Viewer window and Tagger GUI using "TaggerFocus", "MyHotkey/MyCommand" and the command line tool "nircmd.exe".[/li][/ul]

I have difficulties to get this script up and running. Im quite novice with these things so it might be that I have made very simple mistake. I have succeeded to load the script:

I have tried to attach hotkey Alt + T to the script by following the instructions:


But as end result I receive only error messages:

.

Obviously I have done something wrong but I cannot figure out what. Could you help me with this?

I couldn't reproduce the exact error you got but you definitely made something wrong.

  • It doesn't make sense to define a system-wide hotkey for Tagger because the command won't do anything if there is no open lister window.
  • To start Tagger from a viewer window create a Viewer-hotkey.
  • To start Tagger from a lister you'll have to select a file and open a viewer window first using the "Show" command. To do this create a Lister-hotkey with the "embedded command" I provided at the starting post. In the command editor click the "Advanced..." button to be able to paste the multi-line command. It should look like this:


Thanks from fast reply. I have tried to set up the Tagger according to instruction but so far I have not succeeded.

Now the Script looks like this:


When I press Alt + T when file is selected from Lister, the command opens image viewer not Tagger as I expected:


However the Scrip is visible in the Script list and Im able to configure it normally:

Have you got any further proposals how I should proceed?

You are using FILTER=grp:images and the selected file is .pdf. PDF-files are not in the file type group "images" by default. If there's no file matching your filter in the current folder Tagger will do nothing.
Try FILTER=grp:documents or FILTER=
.pdf instead or delete the whole filter argument to make it working with all file types.