Filetags2 - file tagger and metadata viewer

Filetags2.js.txt (54.3 KB)

v1.3 posted 6th October 2025

Overview

Filetags2 can be used to quickly preview, edit, tag and annotate files. It uses the DOpus Viewer, image editors like MS Paint or Photoshop, and the Everything 1.5a utility to leverage the functionality that they provide. Files of any type can be viewed and tagged but the primary focus is image files, typically digital photographs.

The development of this script was prompted by a forum request from @abr Filetags - file tagger and metadata viewer - #32 by abr to make the original Filetags dialog window resizeable. This looked straightforward but it proved to be a lot more "interesting" than I thought and before long Filetags2 developed into a complete rewrite. It relies on features that are only available in recent versions of DOpus 13 (at least 13.13.5) and Everything 1.5a (at least 1.5.0.1373a).

Hopefully Filetags2 operation is largely self evident. Navigation can be done by clicking buttons or by pressing hotkeys for those who prefer to use the keyboard. Many user defined options are available via script preferences. These can be accessed from the dialog by right clicking the Quit | Prefs button. Restart the dialog after making changes. Some defaults are described below.

By Default

  • Filetags2 opens with only selected items in scope, or all items in the current folder if no items are selected. This behaviour can be modified by setting the All option to True in script preferences or starting with the ALL command line option. alt+s can be used to toggle between All and Selected.

  • the dialog opens with two editable metadata fields: User Comment and Tags. Set the imagedesc script preference to true or use the IMAGEDESC command line option to open with a third metadata field which is editable for images and static for other file types.

  • clicking an image preview opens the current file with the DOpus viewer. Shift-click or alt+e opens with editor1 as defined in script preferences (if available) and Ctrl-click or alt+f opens with editor2.

  • right clicking a preview or alt+x advances to the next file and alt+z or rclick in combination with any qualifier key goes back to the previous file. The default rclick action can be changed in script preference to open editor1 or editor2.

  • f10 can be used to toggle an information overlay on the image preview, similar to the DOpus standalone viewer information overlay.

Buttons

Clicking Next with a qualifier key held down will jump to the last in-scope item; similarly clicking Previous with a qualifier key held down will jump to the first in-scope item.

Items can be star rated using the Rate button or one of the rating hotkeys. The default rating hotkeys are alt+0 through alt+5. Clicking Rate in combination with the Shift key will prompt for a rating to be applied to all in scope items.

If the current item is geotagged the Map button will be enabled and can be use to locate where the photo was taken. The user's preferred map utility (Open Street Map, Google Maps, Bing Maps) is set in script preferences. If Everything 1.5a is installed then Nearby will be available as a right click option on the Map | Nearby button. For Nearby to work, geotags must be indexed in Everything Properties. See Properties - voidtools forum .

Existing tags read from disk are sorted and presented line by line. When adding, replacing, or editing, tags can be entered in any order and in any way that DOpus understands. Multiple tags entered on the same line must be separated with semicolons. For example: +holiday;+france;-italy. Care needs to be taken not to inadvertently replace all existing tags. As editing takes place the Apply button is enabled. No changes are made until Apply or alt+a is clicked or the user moves to the next or previous file. When using the Apply button the default is to apply changes to the current file. If a qualifier key is pressed in combination with Apply changes will be applied to all items. By default, a confirmation dialog is shown. This can be overriden with the noconfirmmulti option in script preferences.

When metadata is written to disk there is a time lag before the updated data can be read back to repopulate the editable fields. Filetags2 attempts to allow for this by introducing a short delay between writing the updated metadata and reading it back into the relevant editable fields. If the "old" data persists use the Refresh button. The delay duration in milliseconds can be set in script preferences.

Clicking the Add to coll:// button does what you would expect. Right clicking the Add to coll:// button opens the specified collection in a new lister. If no collection is specified, or the named collection does not exist, all existing collections are listed.

If Everything properties are configured to index tags then the Find button will prompt for tags to be searched. Matching tags are listed in a collection named evquery. Right clicking the Find button will open the evquery collection in a new lister.

Per @abr's original request, the dialog is now resizeable. :smiling_face_with_sunglasses:

Here are a couple of sample screenshots, both taken with the imagedesc option set to true and the second one was taken with information overlay (f10) active.

10 Likes

:+1: :clinking_glasses:

after downloading Filetags2.js.txt
what should i do?
how do i use it?

Pull the trigger :+1:

1 Like

Script in head post updated to v1.1.

// Fix and change log
// 20250325 v1.0 Posted
// 20250326 Fix minver test output statement in Main()
// 20250331 Improve find_exe() logic
// 20250408 Add nearby_tab option to force results to be displayed in the current tab vs the default of a new lister
// 20250515 v1.1 Posted
1 Like

这个插件目前还无法对文件夹进行操作,会提示退出,希望改进一下。还是说需要哪里调整设置?
This plugin is currently unable to operate on folders and will prompt to exit. I hope it can be improved. Or do we need to adjust the settings somewhere?

1 Like

The purpose of the script is to provide a GUI front end to tagging files, not folders so this will happen if you start FileTags2 in a folder that doesn't contain any files.

Reporting a bug: when deleting a tag, if the tag is empty, it cannot be successfully implemented. I asked the AI for advice, and it suggested modifying line 611 from:

报一个BUG,就是删除标签时,标签为空时,无法成功实现,我问了一下AI,它给了一个建议,即在611行将

var tags = vCurTags(0);
for (var i = 1; i < vCurTags.count; i++) tags+=';'+vCurTags(i);

to(修改为):

var tags = ""; // 初始化为空
if (vCurTags.count > 0) { // 只有当有标签时才拼接
    tags = vCurTags(0);
    for (var i = 1; i < vCurTags.count; i++) {
        tags += ';' + vCurTags(i);
    }
}

This successfully achieves the goal of deleting tags
这样在删除标签时就成功实现了.

By the way,why do I receive the prompt "Everything version 1.5.0.1373 or later is required to support 'Nearby' functionality"in the log?
顺便一提,为什么我会在日志中看到这样的消息,"Everything version 1.5.0.1373 or later is required to support 'Nearby' functionality"?

Thanks @cssx for picking up that bug. I will fix it and post updated code in the next couple of days once I have had a chance to test several changes which are needed to fully address the issue.

The Everything version message you are seeing is because you have set the nearby option to true but your installed version of Everything is older than the minimum version that is required to support this functionality.

Script in head post updated to v1.2.

// Fix and change log
// 20250325 v1.0 Posted
// 20250326 Fix minver test output statement in Main()
// 20250331 Improve find_exe() logic
// 20250408 Add nearby_tab option to force results to be displayed in the current tab vs the default of a new lister
// 20250515 v1.1 Posted
// 20250804 Fix issue reported by @cssx - see Filetags2 - file tagger and metadata viewer - #7 by aussieboykie
// 20250804 Clean code to determine what changes, if any, need to be applied to tags, usercomments and image descriptions
// 20250804 Fix handling of noconfirm and noconfirmmulti
// 20250515 v1.2 Posted

@aussieboykie This works fine from a toolbar button. However, when using it in any File Types context menu I receive the following error:

10/5/2025 9:47 AM Filetags2:  Invalid option specified on command line: filetags2 

Here's the context menu entry:

What am I missing?

@Chuck It is probably due to a trailing space after the command. I have updated the code to v1.3 in the head post to deal with that.

1 Like

That did it, thanks!