Re: Export as script
Re: Export as script
- Subject: Re: Export as script
- From: Richard 23 <email@hidden>
- Date: Fri, 17 Nov 2000 23:06:17 -0800
>
But how do you "launch" your compiled scripts? I don't know how to save it
>
as an applet. (Simply getting the Finder to change its creator type to
>
"aplt" and file type to "APPL" and double-clicking it results in some other
>
applet on my hard disk running.) It runs fine from OSA menu or any
>
application's internal script menu. Or I can load it and run it easily. I
>
hope you're not trying to tell a compiled script to "launch"?
If I'm understanding you correctly there's no way that would work.
A compiled script is not an application. It contains a compiled script,
your description text and some window settings, but no runtime code.
Simply changing a compiled script to an applet via creator and type codes
will work no more than setting your browser's codes to a text document in
an attempt to read the source code, or turning a boring read me into a gif
picture to view it in a more colorful way.
R23
Maybe this might be what you're trying to do:
**********
script outScript
property parent: AppleScript
tell application "Finder"
display dialog "Hello World!"
end tell
end script
set filePath to (path to startup disk as string) & "test"
store script outScript in file filePath
set theObj to load script file filePath
run theObj
tell app "Script Editor" to open file filePath
**********
By the way, defining a parent property in the script object as
AppleScript severs the ties between the script object and the
containing script.
If you did the same thing from a really big script, leaving out
the parent property, you'd end up with a big script file, far too
big for the one or two lines that you may think you were saving!
R23