To start with, I'll explain how to do the same thing within a single script, as the concepts are very similar and it simplifies the explanation a bit. Also, if the reason you have two different scripts is just to avoid code duplication, then this approach is likely sufficient.
If you haven't encountered them already, it's worth reading about
handlers (also known as functions, subroutines or methods).
You can provide a parameter to a handler as follows (this example will display a dialog saying "1", then another saying "2"):
Code:
set myVar to 1
testMethod(myVar)
set myVar to 2
testMethod(myVar)
on testMethod(parameter)
display dialog (parameter)
end testMethod
If you want to modify the value of the parameter in the handler, you can return a new value and use that returned value in the original code (there are other ways, but they're a bit more complicated - see "Passing by Reference Versus Passing by Value" in the link above). For example:
Code:
set myVar to 1
set myVar to testMethod(myVar)
set myVar to testMethod(myVar)
on testMethod(parameter)
display dialog (parameter)
return parameter + 1
end testMethod
Doing this across multiple scripts is very similar. When a script is run, AppleScript checks for a special handler named "run". When no run handler is provided, any code left outside a handler is implicitly used as the run handler. By explicitly providing a run handler, however, you can specify a parameter list that lets you provide parameter values from other scripts. You can also return values in the same way as above.
Here's an example that's the same as the second example above, but across two scripts. Script 1:
Code:
set newVal to 1
set script2 to (path to desktop as text) & "Script2.scpt"
set newVal to (run script (file script2) with parameters (newVal))
set newVal to (run script (file script2) with parameters (newVal))
Script 2:
Code:
on run (param)
display dialog param
return param + 1
end run
As above, if you only need to read the parameter and not modify it in script 2, you can omit the "return" line and ignore the return value in script 1.