Re: Why o why won't my script/app open? - solved (it's sneaky)
Re: Why o why won't my script/app open? - solved (it's sneaky)
- Subject: Re: Why o why won't my script/app open? - solved (it's sneaky)
- From: "Charles Arthur" <email@hidden>
- Date: Fri, 2 Nov 2001 12:26:08 +0000
Here's something to notice: if you write and compile (or app-lify) a script
in OSX - even in its Classic layer - which uses OSX-based Scripting
Additions, then if you try to open the compiled script on a Classic-only
machine that's connected to a network, it will look high and low and all
over the network for the X-based version of the Scripting Addition. Even if
you have what you think is the same SA in your System Folder.
The reason: the X-based SA has the suffix of ".app", and editors don't
recognise them as the same thing. Certainly Smile didn't, anyway.
It's certainly pause for thought for anybody developing in OSX for use in a
Classic environment.
The problem I describe (quoted below) turned up because my big script made
calls to URL Access Scripting. I had compiled it (but not run it) on my OSX
machine. When I then tried to open and edit it on the machine running just
9.0.4, it tried to resolve "URL Access Scripting.app", couldn't find it on
the local machine, and set off over the work network looking for it. And
didn't succeed.
(I discovered what was going on because our machines are automatically
logged off the network overnight. I came in and tried again this morning
while still not on the network. The local search failed and so the script
editor - here, Smile - gave up and just asked: "Where is URL Access
Scripting.app?"
This is odd, though - why do scripts that one normally tries to compile
just search your local machine even if you're on a network? Why don't they
*all* set off searching whatever network you're attached to?
I've reported this to Apple as:
"script editors do not resolve the names of OS X-based Apple scripting
additions to their Classic equivalents, due to the difference in name
between the OS X and Classic additions. If you are connected to a network
there is likely to be a very substantial delay on a Classic-only machine
in compiling or decompiling a script or application which was produced on
an OS X-based machine and uses its scripting additions. The delay is caused
by the script editor searching for a scripting addition with the suffix
'.app'."
Yesterday I wrote:
>
So I took this big script, which was procedurally rather than object-ily
>
written, and improved it so that it was more object-oriented - more
>
handlers passing just the relevant things rather than a huge chunk of
>
spaghetti.
>
>
The script lives on a removable FW HD that I carry between two machines,
>
home and work.
>
Home: iBook 500 running X.1 and 9.2.1 Classic.
>
Work: G4 400 running 9.0.4.
>
As the script is big (52K according to the Finder), I edit it in Smile 1.8.4.
>
>
I was able to edit it fine on the iBook - in Smile 184 in Classic. I saved
>
it both as an app and as a >compiled script.
>
Come to try to open it on the G4. Drag it onto Smile: the cursor spins.
>
And spins. And spins. It never stops spinning. The machine locks up -
>
can't switch apps. I went away for 15 minutes to do something useful.
>
Still spinning. Try for force-quit: the machine crashes.
>
Tried again with Smile already running, open file. Same result.
>
Tried with Script Editor 1.6 (even though officially it's too big.)
>
Crashes.
>
>
All other scripts behave fine. This one used to behave fine. (I just
>
checked and can open the original, proedural version fine.)
>
There are no tricky calls in the code - no loading of handlers or
>
other stuff. It's self contained. I've checked it with Resedit, which says
>
that it all seems OK. I've disk-first-aided.
>
>
WTF is going on??? Is this some weird ramification of OSX? If so,
>
what??
>
>
Charles
----------------------------
http://www.ukclimbing.com : 1000+ British crags, 350+ British climbing
walls - searchable by distance and anything else you care to think of -
with weather forecasts for every one, plus maps, articles, news and
features. Plus Britain's busiest climbing discussion boards. And there's
even a cool shop attached.
_____________________________________________________________________
This message has been checked for all known viruses by the
MessageLabs Virus Scanning Service. For further information visit
http://www.messagelabs.com/stats.asp