What would be ideal would be to have a way where one script could
collect a list of object references specific to the InDesign object
model which would remain accessible for the next script to access,
and I'm not sure how to go about implementing this.
on writedata(thedata, fileref)
script DataStore
property p : thedata
end script
store script DataStore in fileref replacing yes
end writedata
on readdata(fileref)
return p of (load script fileref)
end readdata
set fileref to "/Users/has/datastore.scpt" as POSIX file
set thedata to {ref1:document 1 of application "TextEdit"}
writedata(thedata, fileref)
readdata(fileref)
--> {ref1:document 1 of application "TextEdit"}