IF I(eng) DO SET '%eng' #make sure there is an English title set
ELSE DO SET '%ann' #otherwise use the romaji
IF T(Movie) DO ADD ' - %epn' #If it is a movie use the epname (only!), generally would be 'Complete Movie', or 'Part X of Y'
ELSE IF T(!Movie);E(^Volume \d$) DO ADD ' - %enr' #just to avoid things like "animename - 1 - Volume 1 ..."
ELSE DO ADD ' - %enr - %epn' #in "normal case" use the epnumber and epname (if it is not a movie and epname does not include "Volume")
IF G(!unknown) DO ADD ' [%grp]' #use group short name if group exists
ELSE DO ADD ' [no group]' #otherwise mark so
IF D(japanese);D(english) DO ADD '(DUAL JAP+ENG)' #add (DUAL JAP+ENG) if the file is JAP+ENG audio
ELSE IF D(japanese);D(german) DO ADD '(DUAL JAP+GER)' #add (DUAL JAP+GER) if the file is JAP+GER audio
ELSE IF D(japanese);S(none) DO ADD '(RAW)' #Add (RAW) if the file is not subbed and with original japanese audio
ELSE IF D(english);D(!japanese) DO ADD '(ENG DUB)' #if file has english audio only mark it so
ELSE IF D(german);D(!japanese) DO ADD '(GER DUB)' #if file has german audio only mark it so
ELSE IF D(instrumental) DO ADD '(INST)' #mark as instrumental if necessary
ELSE DO ADD '(DUB %dub)' #if it is something else, list whatever the language is...
IF S(!english);S(!none) DO ADD '(SUB %sub)' #If it is subbed in another language than english, list the language (i.e. SUB GER)
IF I(cen) DO ADD '(%cen)' #add (cen) or (unc) - but how to avoid ()?

Everything works fine except for the very last line: for every file that has neither a 'censored' nor an 'uncensored' there are empty brackets added.

I'm not familiar with Java (I created the script above basically by copying from posts in this forum ).
Is there a possibility to check wether the cen-Tag contains explicitly "cen" or "unc", so the Tag is only added in those two cases?

PS: Does anyone know how to limit the categories added with the %gen-Tag? 10 or more categories per file is maybe a bit overdone ...

For the gen-Tag: I was just fooling around with this one, thought in some cases it would be nice to add one or two categories automatically. But if there is no way to do this it's no loss either. Although 'gen' seems to be pretty useless then, doesn't it?

OK, now I use a slightly different script, and this one works. No empty brackets are added. As far as I can tell it seems to be a problem with the comments: adding a comment with "//" works fine, adding with "#" may cause problems.
But as I said - I've no real idea of scripting.
Here is the new script (in case it's useful for someone):

IF I(eng) DO SET '%eng' //make sure there is an English title set
ELSE DO SET '%ann' //otherwise use the romaji
IF T(Movie) DO ADD ' - %epn' //If it is a movie use the epname only. generally would be 'Complete Movie' or 'Part X of Y'
ELSE IF T(!Movie);E(^Volume \d$) DO ADD ' - %enr' //just to avoid things like "animename - 1 - Volume 1 ..."
ELSE DO ADD ' - %enr - %epn' //in "normal case" use the epnumber and epname (if it is not a movie and epname does not include "Volume")
#IF G(!unknown) DO ADD ' [%grp]' //use group short name if group exists
#ELSE DO ADD ' [no group]' //otherwise mark so
IF D(japanese);D(english) DO ADD ' (DUAL JAP+ENG)' //add (DUAL JAP+ENG) if the file is JAP+ENG audio
ELSE IF D(japanese);D(german) DO ADD ' (DUAL JAP+GER)' //add (DUAL JAP+GER) if the file is JAP+GER audio
ELSE IF D(japanese);S(none) DO ADD ' (RAW)' //Add (RAW) if the file is not subbed and with original japanese audio
ELSE IF D(english);D(!japanese) DO ADD ' (ENG DUB)' //if file has only english audio mark it so
ELSE IF D(german);D(!japanese) DO ADD ' (GER DUB)' //if file has only german audio mark it so
ELSE IF D(instrumental) DO ADD ' (INST)' //mark as instrumental if necessary
ELSE IF D(!japanese);S(!english) DO ADD ' (DUB %dub)' //if it is something else, list whatever the language is...
IF S(!english);S(!none) DO ADD ' (SUB %sub)' //If it is subbed in another language than english, list the language (i.e. SUB GER)
IF I(cen) DO ADD ' (%cen)' //add (cen) or (unc) - but how to avoid ()?

c) Movies with "Complete Movie" as episode name get an additional " ' " and spaces at the end, like FID 16230: "A Wind Named Amnesia - Complete Movie' .ogm". Same goes for files with "Part X of Y".

d) [edit] Found one more thing (with FID 96625): an additional space is inserted in the episode name (after "Chapter") although there is none in the filename on AniDB. "Dragon Century - 1 - God Chapter A.D. 1990 Riko.avi"
[edit] OK, now it's getting strange: the additional space is not displayed when I post the filename here in the forum - but it is in the editing window. So just imagine two spaces between "Chapter" and "A.D."

a) bug in server code again
b) "chinese (unspecified)" is the language string. the others are: chinese (cantonese), chinese (mandarin), chinese (simplified), chinese (traditional), chinese (taiwanese)
d) yes, it's like that in the db. you can creq it if you want

c) yeah, bug. webaom looks for the first and last ' to find the actual data to add. then it checks for //. so you get: