Passing variables from one script to another

I know this is possible but cannot for the life of me remember how to do it.
I need one script to run and pass variables from itself into another script.
For example, script 1 would run and use contain certain variables, I would like this script to kick off script 2, then script 2 could use some of the variables from script 1.

I know this is achievable by maybe writing the variables out to a text file and haveing script 2 read them from there, but I think thats the easy way out.

hope somebody can help



Here’s one method that I’ve used, the following is kind of a bare bones example to get you going and it uses LOAD SCRIPT and RUN SCRIPT

SCRIPT 1:Think of this as a module of sorts. It contains properties you can set and get with any other script. Save it as a compiled script or application.

property someProperty : ""

display dialog someProperty--script 2 will load this script and set someProperty to something for us

SCRIPT 2: This is the main script, it loads other scripts and sets properties of the loaded scripts.

set secondScript to load script "Mac HD:Desktop Folder:Script2"--load script 1
set someProperty of secondScript to "Hello Kitty"--set the property "someProperty" of the loaded script to something
run script secondScript--run the loaded script (passes the text from script 1 to the display dialog of script 2)

Hope this helps

Is it possible to pass variables from a script on my machine to a script on a remote machine? I’m trying to write a script that will ask the user for some information, pass it along in a variable to a script on another Mac and have that script process the info on the remote machine.