Adding patterns to FileSets using python

Is it possible to add patterns to FileSets using python scripting? I'd like to be able to use a BeforeAction script to work out the exact patterns I'll need, if that is possible.

Thanks for any advice.

Liam Routt - Krome Studios

Hi Liam

Unfortunately our iron python implementation doesn’t support doing this, however you can use Javascript :

var pattern

Action.FileSet.IncludePatterns.Clear;

pattern = Action.FileSet.IncludePatterns.AddPattern;
pattern.Item = “*.js”;
pattern.Recurse = true;
pattern.Comment = “added at runtime with js”;

You can also reference FinalBuillder variables in the script so you could use python to get the info in another action store the info in variables, and then use javascript in this action to setup the patterns, e.g :

var pattern

Action.FileSet.IncludePatterns.Clear;

pattern = Action.FileSet.IncludePatterns.AddPattern;
pattern.Item = FBVariables.PatternFromPython;
pattern.Recurse = true;
pattern.Comment = “added at runtime from an FB variable”;

HTH

Thanks a lot for the suggestions! I'll look into what makes sense for us in this situation.

Liam Routt - Krome Studios