Re: making a .app script from the command line with osacompile; convert a compiled script to a .app?
Re: making a .app script from the command line with osacompile; convert a compiled script to a .app?
- Subject: Re: making a .app script from the command line with osacompile; convert a compiled script to a .app?
- From: Philip Aker <email@hidden>
- Date: Mon, 26 Aug 2002 21:13:35 -0700
Greetings Chrisopher,
The following might be of some use to you. This script saved as an
application and then double-clicked will create a clone of itself (and
continue to do so until you cancel out of the Save As dialog). Swap out
the 'scpt' (128) resource by another call to Rez in order to get the
new application to have a script of your choosing. (Tested on 10.1.5
and 10.2 only and you'll need to have Developer Tools installed for
this version).
try
set newname to POSIX path of ((choose file name with prompt "Save new
application as:" default name "NewApp.app") as string)
set p2m to POSIX path of (path to me as string)
set forkpath to p2m & "/..namedfork/rsrc"
set carbr to
"/System/Library/Frameworks/Carbon.framework/Versions/A/Headers/
Carbon.r"
do shell script "/Developer/Tools/DeRez " & forkpath & space & carbr &
" > ~/Desktop/derezout.r"
do shell script "ditto " & p2m & space & newname
do shell script "/Developer/Tools/Rez " & carbr & "
~/Desktop/derezout.r -c aplt -t APPL -o " & newname
do shell script "rm ~/Desktop/derezout.r"
do shell script "open " & newname
on error errstr number errnum
if (errnum is not -128) then
display dialog errstr
end if
end try
On Monday, August 26, 2002, at 05:43 PM, christopher ariza wrote:
im trying to make a double-clickable, .app script from the command
line (a
shell script) in osx. i want to simply compile a script with osacompile
and make the result a .app.
using osacompile, we get a compiled, .scpt file. double clicking on
this
opens Script Editor.
if -c and -t flags are set with osacompile to -c"aplt" -t"APPL", we
get an
os9 application that tries to load classic in osx. this is not what i
want. the -x flag makes no difference either.
an option seems to be using osascript to make Script Editor open a
compiled script (produced with osacompile) and save-as an application.
i
cannot, however, seem to get a scripting dictionary for Script Editor
at
all. can one script a "save-as application" in Script Editor?
so my main questions:
1. how can one convert a compiled script to a .app from the command
line?
2. can Script Editor be scripted, and if so, where are the docs or
scripting dicitionary? any examples of doing a "save-as application"
within Script Editor?
many thanks in advance!
christopher ariza
Philip Aker
http://www.aker.ca
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.