Re: Compile a string?
Re: Compile a string?
- Subject: Re: Compile a string?
- From: Andy Wylie <email@hidden>
- Date: Sat, 23 Jun 2001 00:54:52 +1200
on 22/6/01 9:03 pm, Sun Real at email@hidden wrote:
>
G'day Andy,
>
>
Andy Wylie's message of 22/6/01 12:16 PM contained:
>
>
>> Is there a way to compile strings using AS under OS9.x?
>
>>
>
>> I looked at Smile...
>
>
>
> hey Richard, I don't understand what you're trying to do...
>
>
I thought so hard about how to phrase the question too. <sigh> I
>
probably should have specified that I wanted to compile a string into a
>
script. In any case, you did understand. Thanks for the effort. :-}
>
>
>
> ...but maybe this will help...
>
>
> set x to make new script window with properties {name:"foo"}
>
> set text of x to readData
>
> check syntax of x
>
>
Again, thanks - that's what I was looking for. I'd been trying to get it
>
to open & compile my text doc.
>
>
Trying to write it out to a file without user interaction led me through
>
various things to this:
>
>
save x in "Trane:Desktop Folder:foo.as" -- passing a string works,
>
passing a file spec doesn't
>
>
Where is Smile's implementation of the Standard Suite detailed? I found
>
a few lines in the Help, but couldn't find a detailed description
>
anywhere. AppleWorks, for e.g., allows an optional 'saving in' param
>
which suppresses 'saving yes/no/ask' but this didn't work in Smile, as
>
shown.
I've come up against the save without asking problem too (a button script
which cuts the selection of a Smile sheet} my solution was to create the
file outside the application, I use Akua's 'a new file' because I can't
compile the Finder doing it, probably because of Akua %)
------------------
set x to a new file in (path to "desk") named "foo" of type "osas" with
creator "VIZF"
tell application "Smile 1.8.0"
activate
DoOpen(x)
set text of window "foo" to readData
check syntax of window "foo"
do menu 30 to window "foo" --save
do menu 31 to window "foo" --close
end tell
------------------
It's well behaved if check syntax fails but requires a user. It's all in the
dictionary and help, somewhere :-)
_____________________________ Andy