Re: Export as script
Re: Export as script
- Subject: Re: Export as script
- From: Paul Berkowitz <email@hidden>
- Date: Fri, 17 Nov 2000 20:12:20 -0800
On 11/17/00 12:11 PM, "Greg Strange" <email@hidden> wrote:
>
Can anyone direct me to some info about exporting text as a compiled
>
AppleScript? I want to take a sceries of text inputs and put them into a
>
completely separate script. So for instance,
>
>
set outScript to "tell application \"Finder\"" & return & "display dialog
>
\"Hello World!\"" & return & "end tell"
>
>
open for access file "outScriptFile" with write permission
>
write outScript to file "outScriptFile"
>
close access file "outScriptfile"
>
>
I have tried changing the file and creator types to a compiled script but
>
when I try and launch it, it fires off another script on the desktop.
>
>
Anyone have any ideas?
You could get Smile, which is scriptable. The script below will do what you
want when run from another Smile text or script window. It doesn't even need
'tell application "Smile"', although with the tell block, you could even run
it from Script Editor.
---------------------------------------------------------
set outText to "tell application \"Finder\"" & return & "display dialog
\"Hello World!\"" & return & "end tell"
set theName to "Hello World"
set outScript to make new script window with properties {name:theName}
set selection of outScript to outText
check syntax outScript
save outScript in (((path to desktop) as string) & theName)
close outScript saving yes
---------------------------------
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"?
--
Paul Berkowitz