Re: Script on the fly?
Re: Script on the fly?
- Subject: Re: Script on the fly?
- From: "Serge Belleudy-d'Espinose" <email@hidden>
- Date: Mon, 5 Nov 2001 21:22:31 +0100
Ok ok, I must say I was too quick at telling The World what I thought I was the only one to know. So much for the fame :)
However, it took me a while to figure out why what works for Has doesn't for Arthur J Knapp - and me...
At 12:32 -0500 5/11/01, Arthur J Knapp wrote:
>
set header to "script returnCompiledScript" & return
>
set tailer to "end script"
>
>
set a_compiled_script to run script (header & theScriptText & tailer)
As I said before, this doesn't work.
At 18:39 +0000 5/11/01, has wrote:
>
set theScript to "
>
on beepme(n)
>
beep n
>
end beepme
>
"--i.e. your script as text
>
>
run script "script x
>
" & theScript & "
>
end script
>
x"
but this does. So what's the difference? It's in the way the script text is assembled. Arthur starts with
script returnCompiledScript
and ends with
end
while Has starts with
script x
and ends with
end
x
The difference is that if you start with 'script <anyname>', you have to let the last line be '<anyname>' after 'end script' or nothing will be returned.
Or you can start with 'script' and end with 'end script' which, surprise surprise, also returns the script without having to mention it.
Ok, I'm not the first one to find out the compile on the fly thing but at least, I found out by myself :)
Thanks to Has and Arthur anyway.
Serge
--
\\//\//\// Serge Belleudy-d'Espinose Institut Jacques Monod
// // //
http://www.ijm.jussieu.fr/ Universite Paris VII - Jussieu
//\//\//\\