Please forgive this newbie for asking a question whose answer may be obvious to experienced users.
Is it possible to have XYplorer automatically assign a given tag to files with a given extension?
Or, if not, is it possible to write a script that would execute a command like ASSIGN THE TAG "GREY" TO ALL FILES IN THIS FOLDER AND ITS SUBFOLDERS HAVING THE EXTENSION ".WBK"?
David
Auto tagging of extensions?
-
serendipity
- Posts: 3360
- Joined: 07 May 2007 18:14
- Location: NJ/NY
Re: Auto tagging of extensions?
Hi and welcome to XY!davmay wrote:Please forgive this newbie for asking a question whose answer may be obvious to experienced users.
Is it possible to have XYplorer automatically assign a given tag to files with a given extension?
Or, if not, is it possible to write a script that would execute a command like ASSIGN THE TAG "GREY" TO ALL FILES IN THIS FOLDER AND ITS SUBFOLDERS HAVING THE EXTENSION ".WBK"?
David
Dont be hesitant to ask questions, newbies are most welcome here. And regarding your question, yes it should be possible, maybe something like this:
Paste the following code inside menu "Scripting>Try scripting" and see how it works:
Code: Select all
//Hide folders
setting HideFoldersInList;
//select all files
sel a;
//assign tag ID #7 (XY default is gray)
tag 7;
//show folders
setting HideFoldersInList, 0;
//show all items in branch
#263;
//hide folders
setting HideFoldersInList;
//select all files with .wbk extension
selfilter *.wbk;
//assign tag ID #7
tag 7;
-
admin
- Site Admin
- Posts: 66300
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Auto tagging of extensions?
serendipity, I admit I don't do much scripting myself ... but I don't understand the beginning of your script. Why not simply do the lower part? Works here:
Code: Select all
//show all items in branch
#263;
//hide folders
setting HideFoldersInList;
//select all files with .wbk extension
selfilter *.wbk ;
//assign tag ID #7
tag 7;FAQ | XY News RSS | XY X
-
serendipity
- Posts: 3360
- Joined: 07 May 2007 18:14
- Location: NJ/NY
Re: Auto tagging of extensions?
Because Davmay wanted all files to be tagged in current folder and only .wbk in subfolders, if i understood correctly.admin wrote:serendipity, I admit I don't do much scripting myself ... but I don't understand the beginning of your script. Why not simply do the lower part? Works here:
Code: Select all
//show all items in branch #263; //hide folders setting HideFoldersInList; //select all files with .wbk extension selfilter *.wbk ; //assign tag ID #7 tag 7;
-
davmay
- Posts: 17
- Joined: 29 Apr 2009 15:05
- Location: Ottawa, Canada
Re: Auto tagging of extensions?
Serendipity, thanks for your script. If my initial posting was not clear about what I wanted, let me restate it:
FOR ALL FOLDERS IN (GIVEN FOLDER AND ITS SUBFOLDERS) DO:
ASSIGN TAG "GREY" TO ALL FILES WHOSE EXTENSION = ".WBK"
END DO
davmay
FOR ALL FOLDERS IN (GIVEN FOLDER AND ITS SUBFOLDERS) DO:
ASSIGN TAG "GREY" TO ALL FILES WHOSE EXTENSION = ".WBK"
END DO
davmay
-
serendipity
- Posts: 3360
- Joined: 07 May 2007 18:14
- Location: NJ/NY
Re: Auto tagging of extensions?
Oh ok, so Don (admin) was right, just used this script then.davmay wrote:Serendipity, thanks for your script. If my initial posting was not clear about what I wanted, let me restate it:
FOR ALL FOLDERS IN (GIVEN FOLDER AND ITS SUBFOLDERS) DO:
ASSIGN TAG "GREY" TO ALL FILES WHOSE EXTENSION = ".WBK"
END DO
davmay
Code: Select all
//show all items in branch
#263;
//hide folders
setting HideFoldersInList;
//select all files with .wbk extension
selfilter *.wbk ;
//assign tag ID #7
tag 7;
XYplorer Beta Club