How to get meta data from file?

Hi there,

i tried to set a files created/modified date from the meta data of the file. To be more precise, i wanted to get the "year" field of an mp3-file to be the filesystems date of that file (01.01.[YEAR] or something). Can that be done ?

I searched the manual and would know how to set those fields with "SetAttr META .." and so on, but how do you "get" them !?.. o)
I thought of some {}-curly bracket magic at first, but the manual did not help on those.

Thank you!.. o)
Rob.

ps: What i was about to do was: Finding mp3-music by year with the integrated dopus-search. But if i select "music" i cannot choose the "year" field, all i have is "release date", and that is nowhere set in any of my files. So i came up with the idea to retreive the "year" of every mp3 and store it into the filesystem - to eventually be able to search by "year".. o)

You might be able to do that by adapting the 2nd example here: Copy Created/Modified times to/from EXIF times

I'm not sure why "Year" is missing from the Find/Music options, though. Maybe it was just overlooked until now. We should be able to add that in a future version, unless there's some problem I haven't thought of yet.

Hi Leo, yep!..

Thanks for reminding me.. o) I actually downloaded and used your exif-timestamp script, neat!

I was able to modify it, and now my files get their mp3 year! Great!.. o)
The performance sucks big time, but i don't care.. o)

Thank you again for helping!
Rob.

This is the function in detail, if anyone else might be interested:

Rename FILEINFO TO="{mp3year}" RECURSE
@script vbscript
option explicit
dim DOpusRTPath : DOpusRTPath = "d:\bin\file\dopus\dopusrt.exe"
dim Shell : set Shell = CreateObject("WScript.Shell")
Function Rename_GetNewName(strFileName, strFilePath, fIsFolder, strOldName, ByRef strNewName)
	dim strYear, strDateTime, strCommand
	strYear = strNewName
	strNewName = strOldName
	if (len(strYear) <> 4) then
		DOpus.OutputString "Bad year ["&strYear&"] in file: " & strFilePath & "\" & strFileName
		exit function 'not a valid year
	end if
	if (cint(strYear) < 1930) or (cint(strYear) > year(date())) then
		DOpus.OutputString "Bad year ["&strYear&"] in file: " & strFilePath & "\" & strFileName
		exit function 'not a valid year
	end if
	strDateTime = strYear & "-01-01 00:00:00"
	strCommand = """" & DOpusRTPath & """ /cmd SetAttr FILE=""" & strFilePath & "\" & strFileName & """ MODIFIED=""" & strDateTime & """ CREATED=""" & strDateTime & """"
	Shell.Run strCommand,0,true
End Function