Re: Reading Lists and Records from Disk Files
Re: Reading Lists and Records from Disk Files
- Subject: Re: Reading Lists and Records from Disk Files
- From: Richard 23 <email@hidden>
- Date: Tue, 9 Jan 2001 14:40:00 -0800
>
Property parent : load script alias "Hard drive:foo"
>
>
foohandler() -- executes foohandler defined in foo
>
>
fooproperty of parent -- gets fooproperty defined in foo
Well, shut my mouth! That may be very close to what I've been
looking for. Where did the idea to set the parent property to
a loaded script? Fantastic! I've done that with scripts
generated with run script:
-- ---------------------------------------------------------
-- Preprocessed by Convert Script 1.0d2
-- ---------------------------------------------------------
property fungus : "don't eat that!"
on bleep()
beep
end bleep
tell (run script "me
on f(theObj)
script
property parent: theObj
bleep()
return its fungus
--...etc...
end script
end f") to f(me)
set myObj to result
run myObj
-- ---------------------------------------------------------
result:
<beep>
-->"don't eat that!"
but it's a pain and requires "its" which doesn't seem like
it's inheriting, at least not in a useful and convenient
way. I shall have to see if this or something derivative
of this makes my library files more viable.
by the way, "fooproperty of parent" (similar to the "its"
in my example) is not necessary. "fooproperty" works just
fine.
Chaining a number of these together would more than likely
result in all handlers and properties accessible to the last
script object in the chain. Potentially very useful indeed.
Thanks, Jason!
R23