Setting action properties in BeforeAction

I am using 'File/Fileset Iterator' and I want to control by a project variable whether or not the 'Recurse' checkbox on the Details tab of the action is enabled or not.   I have a project variable called 'Recursive' and some VBScript in the action's beforeAction:-

      IF Recursive = "True" then
         Recurse = True
      else
         Recurse = False
      end if

The above doesn't work.   Any suggestions for a fix?

Clive

 

 

Found the solution…
IF Recursive = “True” then
Action.Recurse = True
else
Action.Recurse = False
end if

Clive