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: Why is it



On Jan 29, 2008, at 1:00 PM, Michelle Steiner wrote:

This script takes four seconds to complete:

tell application "Finder"
set foo to entire contents of (path to documents folder)
end tell

This script runs almost instantaneously:

tell application "Finder"
set foo to entire contents of (path to documents folder) as alias list
end tell

Essentially, because the first one returns a more complicated result.  Finder spends about the same amount of time on both, but the first returns a list of object specifiers, all of which will be at least five levels deep, each of which has to be decoded separately, whereas the second one returns a list of aliases, which are atomic objects.  If you're doing that in Script Editor, there's the additional expense of displaying the result -- it can slow way down when you throw a lot of styled text at it.


--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
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Why is it (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.