Re: Store Script Madness
Re: Store Script Madness
- Subject: Re: Store Script Madness
- From: "Serge Belleudy-d'Espinose" <email@hidden>
- Date: Fri, 16 Nov 2001 09:38:56 +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 no 'script <string>' construction - at least not in
8.6 which is what I'm on now...
set theNewScript to script "beep 2"
-- Can't get script "beep 2"
My experience is that you can only assign the result of 'run script
<string>' to a variable, and <string> must be a piece of code that
returns a script object:
set theNewScript to run script "script
on _beep()
beep
end on_beep
end"
-- <<script>>
You can then issue the next command
store script theNewScript in file "file path string"
or as Paul said
store script theNewScript in <alias>
and if you open the resulting script, you will find your code without
the 'script/end' lines.
Serge
--
\\//\//\// Serge Belleudy-d'Espinose Institut Jacques Monod
// // //
http://www.ijm.jussieu.fr/ Universite Paris VII - Jussieu
//\//\//\\