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
automatically name category based on rating
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.