AppleScript speed in Panther--zoom, zoom, zoom!

I’m seeing a tremendous increase in speed of AppleScript in Panther versus Jaguar (10.2.6 in this case). I ran the tests before and after doing an Archive and Install on my TiBook, so I don’t think this is an issue of a clean install improving speed. It is too dramatic regardless…

I have a test script that sends a large number of Apple Events to QuarkXPress 6. In 10.2.6, the script took 390 seconds to complete. In Panther, it takes 195. Do the math…THAT’S TWICE AS FAST.

Quark (which ran extremely slow in v6/10.2.6 versus v4.11/9.2.2) shows the most dramatic increase (it needed it the most). But in other apps, I’m seeing a 25-40 percent increase in scripting speed.

Are any others seeing a difference? For those who have not yet upgraded, it would be interesting run some before/after Finder scripting test.

Ray Robertson
Scripting Matters

I haven’t run timing test but I’m running into all sorts of incompatibilities in my scripts, especially Finder related ones. For instance, open some windows in the Finder, then run this script from Script Editor:

For me, all apps hide but when I switch to the Finder, all the windows are still open. Now comment out the hide line:

Now all of the Finder windows close. Why should it make a difference if the Finder is visible for this to work? It worked fine in 10.2.x.

I’m also running into all sorts of problems with strings getting coerced to Unicode text and the new Script Menu is painfully slow. I’ve also hit a bug in other areas of the OS (see this thread on MacFixIt). I think this is a very significant new OS with lots of new features that are great but I think it may have been rushed out a bit fast.

Jon


[This script was automatically tagged for color coded syntax by Script to Markup Code]

In Jaguar 10.2.8 Jon’s first script closes all windows and hides all applications including the Finder. A click on the desktop unhides the Finder and all windows are closed. The second script, with the commented out line, closes all windows.

Jon,

I do get the same behavior with Finder windows in Panther. In fact, it is confirmed when looking in Script Debugger’s Explorer. When the Finder is hidden, no Windows are shown as existing.

I suspect this was not the only change in the Finder with the amount of work that was done. Although non-standard, the new behavior is not unique. I’ve run into other programs which cannot see objects when they are in fact not showing on the monitor.

Although this won’t help in your case, one of the nice things I’ve found about OSX in general is that brining an app to the front (activate) does not cause as much of a speed hit as it did in OS9. At least in the apps I work with the most.

Ray Robertson

Whether the extensions are loaded or unloaded, QuarkXpress is twice as slow when using AppleScript to drive the application. And when running the script from within a Script editor, QuarkXpress 6.1 is only then twice as fast as older versions. Anybody have any ideas how to make this work without using a Script Editor of some sort?
I am officially running Script Debugger 3.0.8

Interestingly this script which uses System Events to count the windows, will count correctly, but trying to close them will give you an error.


[This script was automatically tagged for color coded syntax by Convert Script to Markup Code]