AppleScript saving global variable
I usually save text files as the variable they are named after, and recall them in other scripts. I use a folder in /var, i created my own hidden folder so it wouldn't clutter it too much. You can make hidden folders with mkdir in terminal. Example: mkdir /var/.scriptvariables