SSIS - Script task: Replace TEXT in text file using VBscript with dynamic file path

Use @Alex's answer to add and reference variables. But just an FYI that you can do your entire script in 2 lines of code if you use System.IO.

so add this to the imports section

Import System.IO

Then use these lines in your MAIN Sub

Dim filePath As String = Dts.Variables("User::FullFilePath").Value.ToString()
File.WriteAllText(filePath, File.ReadAllText(filePath).Replace("Jim", "James"))
ɐlǝx

You can pass your customer variables to the [task script] in tab Script using ReadOnlyVariables and/or ReadWriteVariables, after having defined the variables globally; take a look here

More in detail:
to add variables to your project you can select the [Variables] tab in the upper left in the Package, than insert requirend fields:

enter image description here

Variables can be added to the [task script] by selecting them as ReadOnlyVariables and/or ReadWriteVariables:

enter image description here

so you can use within the [task script] by declaring:
Dts.Variables("User::Variable").Value

as @Matt says online documentation omits 'User::'