Page 1 of 1

Simple script for replacing a specific field...

Posted: 2008-07-23 12:17:54
by LaMaOne
Hi,

I am in need of a script to adjust a specific field throughout my whole movie database.

I have 758 movies in my database. 351 of those movies have the "Media Type" field set to MKV.
I need the MKV string changed into x264 720p.
Doing this manually by hand will take me a while and I assume it should be fairly easy to write a quick script to achieve this.

I've been reading the documentation and the forums but simply put, I'm a total noob at this and haven't a clue where to start.

I assume the script would have to look something like this:

Code: Select all

program ReplaceField;
begin
  SetField(fieldMediaType, 'x264 720p');
end.
However this replaces the Media Type field to x264 720p for every single movie in the database. I assume I would need to include some if statements, somewhere.

Could someone point me in the right direction or write a quick script to do just this?

Thank you very much.

Regards,
LaMa

Posted: 2008-07-23 12:28:11
by antp
Hi,
Here is it:

Code: Select all

program ReplaceField;
begin
  if GetField(fieldMediaType) = 'MKV' then
    SetField(fieldMediaType, 'x264 720p');
end.