Tag add/remover

Discuss and share scripts and script files...
Post Reply
binocular222
Posts: 1414
Joined: 04 Nov 2008 05:35
Location: Hanoi, Vietnam

Tag add/remover

Post by binocular222 »

A popup menu appear listing all tags from Tag list (xyplorer.ini) + tags on currently selected item + Clipboard (no duplicate)
+ If user select the tag which already existed in current file → untag
+ Else: add tag.
+ "New tag" menu item allow traditional type-to-add method
+ "Edit tag database" menu item edit tag database in xyplorer.ini
+ "Clear all" remove all Label, Tag, Comments
+ Clipboard contain maximum 20 character and invalid characters are removed: ,|"<crlf>

Code: Select all

 $Taglist = formatlist(getkey("TagsList", "Settings") . ", " . property("#tags") . ", ",  "etsd", ",");
 $Clipboard = replacelist( substr(<clipboard>, ,20), "<crlf>"",|;""");
 $MenuItem = trim(popupmenu($Taglist . ",-,$Clipboard,-,&New tag,&Edit tag database,&Clear all",,,,,, ","));
 if( $MenuItem == "&New tag") { #881};
 Elseif( $MenuItem == "&Edit tag database") {setkey( input("Edit Tag database in xyplorer.ini",,getkey("TagsList", "Settings")), "TagsList", "Settings")};
 Elseif ( $MenuItem == "&Clear all") {tag; #886; tag,,2};
 Elseif( strpos(property("#tags"), $MenuItem) == -1) {tag $MenuItem,, 1};
 Elseif ( $MenuItem != "") {tag $MenuItem,,1,2}
If possible, then I wish this popup menu to replace current XYplorer's popup menu when right click on Tags.
I'm a casual coder using AHK language. All of my xys scripts:
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488

Post Reply