In applescript can you use a variable that was defined in another script? I think you would have something like:
set test to (load script "/tmp/a.scpt")
But how would you pick a specific variable?
You could use property variables in your external script
e.g, a.scpt:
property foo : "hello world"
...and in the calling script you use the "x of n" style of referencing.
set test to (load script "/tmp/a.scpt")
display dialog (the foo of test)
You can also access the returned result of a handler in the external script.
e.g, a.scpt:
on getChoice()
set res to choose from list {"one fish", "two fish", "red fish", "blue fish"}
return res
end getChoice
...and in the calling script:
set choice to getChoice() of test