Re: Store Script Madness (second try at posting)
Re: Store Script Madness (second try at posting)
- Subject: Re: Store Script Madness (second try at posting)
- From: "Serge Belleudy-d'Espinose" <email@hidden>
- Date: Fri, 16 Nov 2001 11:47:49 +0100
At 21:57 -0600 15/11/01, AppleScript Greg wrote:
>
>> store script theNewScript in file (newScript)
>
>>
>
>> Gives me an error ("Can't make some data into the expected type.") and I
>
>> swear I can't figure it out. I even stripped it down to theNewScript to
>
>> "beep 2".
AFAIK there is not 'script <string>' construction; the following line
errors on my machines - 8.6 to 9.1:
set theNewScript to script "beep"
In my experience the only way to create a script object is to use the
following construct:
set theNewScript to run script "script
on _beep()
beep
end _beep
end script"
where you get the result of run script which, in this case, returns a
script object. Then you can use your command:
store script theNewScript in file (newScript)
provided that you take care of the problem Paul mentionned. If you
open the resulting script, you will find your code excepted for the
first and last lines 'script/end script'.
Serge
--
\\//\//\// Serge Belleudy-d'Espinose Institut Jacques Monod
// // //
http://www.ijm.jussieu.fr/ Universite Paris VII - Jussieu
//\//\//\\