Quick Keyword Tagging (AHK Script)

Ideas for improvements and requests for new features in XnView MP

Moderators: XnTriq, xnview

Posts: 3
Joined: Sun Oct 01, 2017 5:22 pm

Quick Keyword Tagging (AHK Script)

Postby joShu » Sun Oct 01, 2017 6:44 pm

I tag my images (research pictures and journal entries) with custom keywords.
Then I use those keywords to quickly find and filter images.
Bonus: An image's keywords are detected and displayed by Windows Explorer and are automatically indexed by the Windows Indexing Service.

XnViewMP has a nice way to add multiple keywords to each image.
But the keyword-tagging interface is clunky because you have to use the mouse a lot (= slow).

Solution and Ideas
So, I wrote a rough AHK script that speeds things up (a lot) for me and perhaps you might be able to use it also.
Or, perhaps it will give the XnView authors some ideas.
Or, perhaps someone knows a faster way yet.

Sorry, I am not an AHK wizard so the script is not very polished so it is not for beginners.
To use the script you should already know the following:
- how to create, manage and assign keywords in XnViewMP
- how to use AHK scripts and tweak the code for your environment.

Code: Select all

; PURPOSE: Helps cycle through the screens when tagging images with Keywords using XnViewMP
; USAGE: Type a few letters to select a tag and then hit enter. Repeat for all keywords for the image.
; USAGE: Hit F9. It will then save the keywords into the image and then advance to the next image.
; PREP: Open XnViewMP, Details View, open the folder, select an image.
; PREP: Open the folder-view in XnViewMP on monitor1. Get the full screen view going on monitor2.
; PREP: Ctrl I to open the Edit window. Select the Keywords tab. Make sure that the keywords are already loaded.
; PREP: Select the tags for the first image. It is now at the point where the cycle of using the AHK can begin.
; TO RUN: Run this .ahk and switch to the window where you have selected the tags of your image.
; IDEAS:    if XnViewMP windows are not open, then open them

#NoEnv        ; Recommended for performance and compatibility
#Warn           ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
#SingleInstance force

msgbox F8 = Save and go to Previous Image`nF9 = Save and go to Next Image`nX = Exit AHK`n`nSwitch over to XnViewMP, Ctrl I, Keywords to begin.

   Sleep, 333
   Send, {LShift Down}{Tab}{LShift Up}{Space}{Tab}

; Save and go to Previous Image
   Sleep, 333
   Send, {Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Left}{Enter}
   Sleep, 666
   Send, {Up}
   Sleep, 333                                  
   Send, {LControl Down}{i}{LControl Up}
   Sleep, 666
   Send, {LControl Down}{Tab}{LControl Up}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}

; Save and go to Next Image
   Sleep, 333
   Send, {Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Left}{Enter}
   Sleep, 666
   Send, {Down}
   Sleep, 333                                  
   Send, {LControl Down}{i}{LControl Up}
   Sleep, 666
   Send, {LControl Down}{Tab}{LControl Up}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}
;Exit AHK presumes that no tag begins with X, otherwise ALT x

Return to “MP - Suggestions”

Who is online

Users browsing this forum: No registered users and 2 guests