Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AppleScript runs slow on Intel Macs



On Sep 21, 2006, at 4:01 PM, Michelle Steiner wrote:

On Sep 21, 2006, at 11:50 AM, Christopher Nebel wrote:

A suggestion on my local Mac forum is that the Intel Mac's require AppleScript files to be saved as bundles, else they will be run as PPC files by Rosetta.

Can anyone confirm or contradict that?

That's true if and only if you're referring to scripts saved as applications. The script itself does not contain any PPC or x86 code -- it's data that's fed to the AppleScript interpreter. What matters is the flavor of the executable running the script.

Are you saying that if you save a script as an application, without saving it as an application bundle, it will require Rosetta to run? Even if you're saving it on an Intel Mac?

That's correct.

But why does this script take anywhere from 18 to 25 seconds on a 1.83 GHz Intel iMac?

tell application "Finder"
	repeat 1500 times
		get current date
	end repeat
	beep
end tell

Yet this one is almost instantaneous
set x to 0
tell application "Finder"
	repeat 1500 times
		set x to x + 1
	end repeat
	beep
end tell

Because the first one sends 1500 events to the Finder (which may be busy doing other things, hence the variance), and the second one doesn't. Math operators are executed entirely in-process, regardless of any "tell" block. Try watching the event log.



--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:
http://lists.apple.com/mailman/options/applescript-users/email@hidden

This email sent to email@hidden
References: 
 >Re: AppleScript runs slow on Intel Mac's (From: Leif Ă–quist <email@hidden>)
 >Re: AppleScript runs slow on Intel Macs (From: Christopher Nebel <email@hidden>)
 >Re: AppleScript runs slow on Intel Macs (From: Michelle Steiner <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.