Hello,
is it possible to save the filename in the comment(field).
Hello123.avi -> Then Comment: Hello123 or Hello123.avi
It could be a XYComment or a Windows Comment.
I have thousand of files, so a batch file would be great.
Thank you for your help.
Mattwill
filename as comment of the file (batch)
-
highend
- Posts: 14953
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: filename as comment of the file (batch)
Takes all files from the current folder (non recursive)...
Code: Select all
// Take the base name of a file and put it in the comment field
foreach($file, listfolder(, "*", 1, "|"), "|") { tag getpathcomponent($file, "base"), $file, 2; }One of my scripts helped you out? Please donate via Paypal
-
mattwill
- Posts: 4
- Joined: 24 Dec 2013 00:41
Re: filename as comment of the file (batch)
Thank you for your help! It works! A beer is on your way 
-
highend
- Posts: 14953
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: filename as comment of the file (batch)
No problem and thanks!mattwill wrote:Thank you for your help! It works! A beer is on your way
One of my scripts helped you out? Please donate via Paypal
-
mattwill
- Posts: 4
- Joined: 24 Dec 2013 00:41
Re: filename as comment of the file (batch)
When i change the filename, the comment is gone!
But i would save the original filename as comment, so i could rename the files.
Is there any chance to do that.
Thank you for your help!
But i would save the original filename as comment, so i could rename the files.
Is there any chance to do that.
Thank you for your help!
-
highend
- Posts: 14953
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: filename as comment of the file (batch)
I guess you could use a tag instead (sorry, I don't work neither with comments, nor with tags).
Tags will be overriden, be careful.
Change this part
to
Menu - Tools - Configuration... - Startup & Exit - Save settings on exit should be checked (to save tags on exit)
Tags will be overriden, be careful.
Change this part
Code: Select all
{ tag getpathcomponent($file, "base"), $file, 2; }Code: Select all
{ tag getpathcomponent($file, "base"), $file, 1, 1; }One of my scripts helped you out? Please donate via Paypal
-
admin
- Site Admin
- Posts: 66350
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: filename as comment of the file (batch)
This should not happen when you change it within XY. Do you?mattwill wrote:When i change the filename, the comment is gone!
FAQ | XY News RSS | XY X
-
mattwill
- Posts: 4
- Joined: 24 Dec 2013 00:41
Re: filename as comment of the file (batch)
Thank you for your hint.
Renaming it in XY, the comment is kept.
Renaming it in XY, the comment is kept.
XYplorer Beta Club