same variable different applescripts

Is there anyway to set a variable as something in one applescript applicaiton and then use that same variable in another applescript application?


the easiest solution is to store the variable in a plist file in ~/Library/Preferences.

Scripts can read properties from other scripts. Just:

Script 1:

property myVar: 0

Script 2:

set otherScriptPath to ("path:to:script1.scpt")

-- load the script
set otherScript to load script file otherScriptPath

-- read the property
otherScript's myVar

-- you can even set the property to some other value
set otherScript's myVar to 2
-- just remember to save it back
store script otherScript in otherScriptPath with replacing