is it possible to load a script library with a creation handler
is it possible to load a script library with a creation handler
- Subject: is it possible to load a script library with a creation handler
- From: Timothy Bates <email@hidden>
- Date: Sun, 01 Apr 2001 02:51:52 +1000
hi there,
I now understand how neat script libraries are (took me a while).
I have a nifty library which should be initialised when I create an instance
of it.
I was doing this with a handler that contained the script, but I want to
move to loading the scripts from file. Unfortunately, now I cannot see how
to force the user to initialise the object when they create it because you
can't pass parameters to the load script command. Is there anyway around
this?
To help explain, my old script (gutted for simplicity) was:
set myStaircase to my createNewAdapativeStairCase({1,2,3})
returnParameters() of myStaircase
--> {1,2,3}
on createNewAdapativeStairCase(parameterList)
script staircase
property parameters: parameterList
on returnParameters()
return parameters
end returnParameters
end script
end createNewAdapativeStairCase
Does anyone out there have any clues on including a handler like this in a
loadable script object so that it is called at load time? Is thought that
load like be like "run" so I could simply include the code and gets called
automagically, but no dice.
tim