automatically name category based on rating

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
scottdw
Posts: 23
Joined: 2004-01-13 19:44:57

automatically name category based on rating

Post by scottdw »

I import the movies rating (G,PG,PG-13) from DVDEmpire but would like to be able to in a script have it automatically fill in the category field with a custom category name based on the rating.

For example if the rating is G or PG name the category field "Kids"
or if the rating is R or NC-17 name it "Adult".

Can someone give me an example of a script that I can customize to do this.

Thanks,
Scott
antp
Site Admin
Posts: 9629
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

Supposing that the category field already contains the rating (else just change the field name in "getfield" line)

Code: Select all

program NewScript;
var 
  s: string;
begin
  s := GetField(fieldCategory);
  if (s = 'R') or (s = 'NC-17') then
    SetField(fieldCategory, 'Adult')
  else
  if (s = 'G') or (s = 'PG') then
    SetField(fieldCategory, 'Kids')
end.
scottdw
Posts: 23
Joined: 2004-01-13 19:44:57

Post by scottdw »

Thanks alot.
Post Reply