Re: Opening AppleScript *.app files for editing
Re: Opening AppleScript *.app files for editing
- Subject: Re: Opening AppleScript *.app files for editing
- From: Christopher Nebel <email@hidden>
- Date: Mon, 25 May 2009 21:19:36 -0700
On May 24, 2009, at 8:04 PM, Doug McNutt wrote:
At 18:09 -0600 5/24/09, I wrote a question about opening a .app for
editing..
It turns out that I didn't copy the resource fork to the new
directory. CpMac repaired most of the damage.
After opening up the /Users/jim/bin/ directory I was able to edit
and save the APPL but I couldn't just save. I had to do a save-as
and redeclare it to be an APPL. Script Editor doesn't mind just
saving in my space. It's only on Jim's space, while logged in as me
with admin privileges, that I have to do the save-as thing.
But now I'm worried about using my AppleScript on Tiger or Leopard.
I was a bit surprised to find the binary in the resource fork the
way things were on 68k boxes. Is that still the case in more modern
versions of OS neXt? What about Intel machines?
What you're seeing is the distinction between saving as an
"application", which is a PowerPC-only single-file application, versus
an "application bundle", which is a PowerPC/Intel file package. Both
of them work fine on Leopard, Tiger, and even Panther (10.3) systems,
though application packages won't work on anything older than that.
The single-file format has the bits it needs to run all the way back
to System 7.1, though whether or not your script works is a separate
question.
As a practical matter, copying single-file applications requires
copying the resource fork (as you've already discovered), so use
Finder, CpMac, or ditto(1). (You'll need to manually specify "ditto --
rsrc" if you're on 10.3 or earlier.) Copying bundled applications can
be done using cp -R, since all the files in the package use only the
data fork.
As for script files (as opposed to applications), data-fork scripts
have been the default for a while, at least from Script Editor.
osacompile(1) still outputs the old-fashioned resource-fork scripts by
default; use "-d" to get a data-fork one.
--Chris Nebel
AppleScript Engineering
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden