Re: Can a script create an applet?
Re: Can a script create an applet?
- Subject: Re: Can a script create an applet?
- From: "Arthur J Knapp" <email@hidden>
- Date: Fri, 02 Feb 2001 14:20:11 -0500
>
From: email@hidden
>
Date: Thu, 1 Feb 2001 19:23:30 EST
>
Subject: Re: Can a script create an applet?
>
If this can be done vanilla it could be very useful...eg self conatined
>
installers for pro script-based apps. Ive fooled around with it a bit, but so
>
far nothing.
!!! Not Extensively Tested !!!
-- Your "installer" script, saved as an applet:
--
script HelloWorld
on run
display dialog "Hello World"
end run
end script
on run
set ThisScript to path to me
tell application "Finder"
-- Ues the installer itself as an applet-template
--
set TheApplet to duplicate ThisScript
-- After setting the name of TheApplet, I could no longer
-- access it as a Finder object, so:
--
set TheApplet to TheApplet as alias -- ? bug ? work-around
-- Name the applet
--
set name of TheApplet to "HelloWorld"
-- Put the script into the applet
--
store script HelloWorld in TheApplet replacing yes
end tell
beep 2
end run
-- -----------------
After you have clicked this, there should be another clickable-applet
in the same folder as your installer script called "HelloWorld". When
you open the HelloWorld applet up in a script editor, you should see:
on run
display dialog "Hello World"
end run
Note: Despite the fact that this works, I assume that it is probably
unstable and not really recommended, (but don't let that stop
you). ;-)
--
{
Arthur J Knapp, of STELLARViSIONs ;
http://www.STELLARViSIONs.com ;
mailto:email@hidden ;
"...well the rain falls down
without my help, I'm afraid
and my lawn gets wet,
though I withheld my consent..."
}