• I have worked around it by creating a new script task and assigning the variables in that (copy and pasting the code form the script task that won't work) - this works fine.

    Thanks for the help everyone.