How to walk a list of files in a lister and change metadata

I'm new to Dopus scripting (but not to programming). What I want to do is create a script that will walk through a list of movie files and change the metadata Title to the filename (without extension) of the movie. My DVD ripping software writes the title of the DVD to the metadata Title which isn't always the same as the title of the film.

So, to the question: how can I walk a list of files that are visible in a lister, extract the filename and write the filename to the metadata Title field? I'm reading through the help but by the time I actually get to understand fully it would have been quicker to do it by hand! I don't need the script writing for me (although if you want to that would be great!) just really pointing in the right direction.

Cheers!

Leo wrote this back in 2012:

@sync:dopusrt /acmd SetAttr {filepath} META title:{file|noext}

But with testing under version 11.7, It doesn't seem to work anymore. It works fine for "comment" but not "title".

[quote="ktbcrash"]Leo wrote this back in 2012:

@sync:dopusrt /acmd SetAttr {filepath} META title:{file|noext}

But with testing under version 11.7, It doesn't seem to work anymore. It works fine for "comment" but not "title".[/quote]

If I select a range of films, it seems to work fine on my system and I'm using v11.7.

That command was so much more simple than I expected! I was expecting to have to write quite an involved script!

Only one problem I have noticed, updating the metadata Title field doesn't update the file's modified time-stamp, any way to to this as well at the same time? I use the modified time-stamp to determine which files need to be backed up under an automated process.

Thanks.

Interesting that it doesn't work for me. Oh well. I don't need it to work :slight_smile:

I believe this will work for you:

@nodeselect @sync:dopusrt /acmd SetAttr {filepath} META title:{file|noext} lastmodifieddate:now

You can leave the @nodeselect on or off. I like my files to remain selected after the command has run. It's not needed to make it all work.

Thanks for your help, that works fine. :slight_smile:

There's also Preferences / File Operations / Metadata / Update last modified file dates when setting metadata if you always want metadata edits to bump the timestamp.

I had actually got that set but it didn't appear to do anything with the script that was given earlier and also with the Edit Metadata Command (I made a button from the Edit MetaData command)