GP SoftwareTwitter
Opus FAQsManualCommandsObjects

XTag - A command which simplifies filename tagging and rating

= About ===

After a few years of internal use I decided to share this command which makes my life a lot easier when managing my files. It appends tags to filenames themselves so don't use it if those files' filenames are not expected to be changed. After tagging you can use wildcard labels or custom regex columns to sort and filter the data your way. They're most useful bound to different buttons or keyboard shortcuts for quick tag work.

= What it does ===

XTag takes specific arguments and switches and appends or removes tags / ratings from your selected files. It honors uniqueness so you'll never get a duplicate tag unless you choose different delimiters. Running the same command on a tag toggles it. Rating can be toggled with the RATINGTOGGLE switch or just unset with RATING=0.

= Options and switches ===

LTAG/O Left tag text. Comes at the beginning of the filename. Use your own delimiter.
RTAG/O Right tag text. Comes at the end of the filename. Uses default ( ) or switched DELIM [ ] ( ) _.
DELIM/O Sets delimiter type for RTAG with one of these:

  • SquareBrackets or SB - changes tag bracketing to [ and ]
  • RoundBrackets or RB - changes tag bracketing to ( and )
  • Underscores or US - changes tag bracketing to only use underscore on left as _tag

RATING/O Set rating 0-9 with 0 being remove any rating.
RATINGSYMBOL/O Set rating symbol to something other than a unicode star.
RATINGTOGGLE/S Setting the same rating on a file again toggles it.
NODESELECT/S Don't deselect files after performing an action. Useful if you have second thoughts.

= Usage ===

You can combine any or all things in one command line for something like this:

Sample Filename.txt 

XTag LTAG=[-Data-] RTAG=Heavy DELIM=SB RATING=5 RATINGSYMBOL=💀

[-Data-] Sample Filename [Heavy] 💀5.txt

= TAG usage ===

Tags are always toggling. If you have both LTAG and RTAG in the same command on the same line and only one of them exists already in the filename - first run will clear them. Second will set them both.

I'll illustrate what happens in a filename after executing the command with different arguments sequentially on the same filename.

More TAG examples
Sample Filename.txt 

XTag LTAG=+Item+ RTAG=ToDo

+Item+ Sample Filename (ToDo).txt

XTag RTAG=ToDo

+Item+ Sample Filename.txt

XTag RTAG=Food DELIM=SB

+Item+ Sample Filename [Food].txt

XTag RTAG=Drink DELIM=SB

+Item+ Sample Filename [Food] [Drink].txt

= RATING usage ===

Required
Use RATING={Single Digit Number} to set a rating. RATING=0 always clears.
Optional
Using the RATINGTOGGLE switch removes the exact rating if it's found.
Using the RATINGSYMBOL option you can set a rating symbol different from ★.

Setting new ratings always overrides the previous if any.
I'll illustrate what happens in a filename after executing the command with different arguments sequentially on the same filename.

Some Rating Examples
Sample Filename.txt 

XTag RATING=3

Sample Filename ★3.txt

XTag RATING=6 RATINGTOGGLE

Sample Filename ★6.txt

XTag RATING=6 RATINGTOGGLE

Sample Filename.txt

XTag RATING=7

Sample Filename ★6.txt

XTag RATING=0

Sample Filename.txt

You can change the rating symbol with the RATINGSYMBOL switch. By default we use a unicode star ★.

XTag RATING=8 RATINGSYMBOL=❤

Sample Filename ❤8.txt

= Known Issues ===

No undo support. Use toggles to toggle what you did and simulate an undo operation.
image
As it is I can't seem to find a way to use undo when renames are being called from within a Command.Run list.

= Download ===

Version 1.0 : XTag.rar (3.0 KB)
Put XTag.js in your /dopusdata/Script AddIns folder

1 Like