Simple script for replacing a specific field...

If you made a script you can offer it to the others here, or ask help to improve it. You can also report here bugs & problems with existing scripts.
Post Reply
LaMaOne
Posts: 2
Joined: 2008-07-23 11:59:40
Location: .NL

Simple script for replacing a specific field...

Post 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
antp
Site Admin
Posts: 9652
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

Hi,
Here is it:

Code: Select all

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