• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: osacompile and making an application
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: osacompile and making an application


  • Subject: Re: osacompile and making an application
  • From: Paul Skinner <email@hidden>
  • Date: Thu, 20 Feb 2003 13:52:34 -0500

On Thursday, February 20, 2003, at 12:54 PM, Christopher Nebel wrote:

On Wednesday, February 19, 2003, at 11:27 PM, Donald Hall wrote:

I am trying to use the osacompile command to make a script application. However, I'm having no luck. I did the following after reading the man page:

osacompile -d -c 'aplt' -t 'APPL' -o outputfilename inputfilename

The resulting output claims to be an application in the Get Info window, but it doesn't run when double clicked. It also has the classic script application icon, but this could be because it is missing a lot of resource data that an application created by Script Editor has.

Does anyone know if it's possible to create an application with osacompile? I thought specifying the type and creator codes would make it an application, but apparently not.

Unfortunately, it's not as simple as just setting the type. There's a bunch of other goop that makes up a script application -- an executable stub, an icon, etc. What you can do is insert your script into an existing applet:

1. Save a script application from Script Editor. (The script doesn't matter much, but if you want to end up with a droplet, you'll need to save a script with an open handler.)

2. osacompile -r scpt:128 -o applet inputscript

Zap! It's done. Doing all this automatically from a script -- cloning a skeleton addition and osacompiling into it -- is left as an exercise for the reader. (Getting osacompile to spit out an applet in the first place is an already requested feature.)


--Chris Nebel
AppleScript Engineering

You should include a '-t APPL' to keep it from reverting to a compiled script. But using this code I've actually been able to get it to work. To test this code, put an applet at the root of your hard drive and name it 'hostApplet'.

do shell script "osacompile -r scpt:128 -t APPL -o hostApplet -e " & quoted form of "say \"Hello World\""

Very handy! I still hope for the applet feature to be added.
--
Paul Skinner
_______________________________________________
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.

References: 
 >Re: osacompile and making an application (From: Christopher Nebel <email@hidden>)

  • Prev by Date: FaceSpan and Databases/Data Storage
  • Next by Date: Re: osacompile and making an application
  • Previous by thread: Re: osacompile and making an application
  • Next by thread: Re: osacompile and making an application
  • Index(es):
    • Date
    • Thread