• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Slow Command in Snow Leopard
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Slow Command in Snow Leopard


  • Subject: Re: Slow Command in Snow Leopard
  • From: Luther Fuller <email@hidden>
  • Date: Wed, 07 Apr 2010 08:32:36 -0500

On Apr 7, 2010, at 6:41 AM, Axel Luttgens wrote:
It often appears that you insist on asking applications to build AppleScript lists when not really needed.

If you want the Finder to count disk items, just ask the one who knows, that is the Finder:

Yes, but the point of the scripts was to test how fast Finder, System Events and 'ls' could build a list.

The line ...

set itemCount to (count files of entire contents of folder folderAlias)

does work fairly quickly. However the following test script ...

on open dropList
if (count items of dropList) > 1 then return
set folderAlias to (item 1 of dropList) as alias
tell application "Finder" to if (class of item folderAlias) is not folder then return
set elapsedTime to (current date)
--
date (date string of (current date))
set cutoffTime to ((the result) - (15 * days))
tell application "Finder"
if (exists (some document file of entire contents of folderAlias whose modification date < cutoffTime)) then
set itemExists to true
else
set itemExists to false
end if
end tell
--
set elapsedTime to ((current date) - elapsedTime)
"item = " & itemExists & return & "time = " & elapsedTime & " sec"
display dialog the result buttons {"OK"} default button 1
end open


Takes 7 sec with the 532 item folder used in the previous tests (which has no sub-folders) and
8 seconds on a folder containing 286 files distributed among 52 sub-folders. This is way too slow.

I was using the 'exists ...' line in an application where it was intended to speedup the action, but it had the opposite effect and I had to remove it. It was quicker just to scan all sub-folders.

 _______________________________________________
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

  • Follow-Ups:
    • Re: Slow Command in Snow Leopard
      • From: Thomas Fischer <email@hidden>
References: 
 >Slow Command in Snow Leopard (From: Luther Fuller <email@hidden>)
 >Re: Slow Command in Snow Leopard (From: Axel Luttgens <email@hidden>)

  • Prev by Date: Re: Slow Command in Snow Leopard
  • Next by Date: Fwd: Filemaker Find Question - Help please... (Solved)
  • Previous by thread: Re: Slow Command in Snow Leopard
  • Next by thread: Re: Slow Command in Snow Leopard
  • Index(es):
    • Date
    • Thread