• 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: Script that "Tells" Finder just Focuses on Finder instead of running
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Script that "Tells" Finder just Focuses on Finder instead of running


  • Subject: Re: Script that "Tells" Finder just Focuses on Finder instead of running
  • From: Shane Stanley <email@hidden>
  • Date: Fri, 09 Jan 2015 15:10:45 +1100
  • Sun-java-system-smtp-warning: Lines longer than SMTP allows found and truncated.

On 9 Jan 2015, at 2:17 pm, 2551 <email@hidden> wrote:

I'm curious as to how this performs on people's home folders. 

Like the intitial offerings in this thread, I find this runs but doesn't return within 2 minutes (in fact, I let it run for 9 minutes and it stil didn't return; fans, of course, were maxing out at 6200rpm). 

Admittedly that's on a reasonably old mac (2009 MBP), but with 8GB RAM and a two-disk internal "Fusion" drive (125GB SSD and 750GB, 7200rpm platter). The combined drive is 50% free and the home folder, if Finder is to be believed, is 370GB. 

I know that's a lot of work, but I'd still expect anything usable to return within a couple of minutes, especially given the relative speed of using ls -R by comparison. Unlike Shane, my laziness has thus far got the better of me in terms of trying to improve the formatting of the shell script option. If I get the chance over the weekend I'll have a go at it, unless others report this script returns the home folder in reasonable time (in which case perhaps I have a local issue that's causing the problem).

I wouldn't be surprised to see it go over 2 minutes -- it's up to 28 seconds here with the latest version, for only 135GB -- but 9 sounds crazy. RAM probably makes a lot of difference because it's used for directory caching, but that shouldn't favor any particular method.

If anyone wants to try at home, you can change the top to be like this:

use scripting additions
use framework "Foundation"

-- this where we'll store the stuff as we collect it; we could use a list, but it could get very long
set finalNSArray to current application's NSMutableArray's array()
-- make NSURL of where to start
set thePath to POSIX path of (path to home folder)
set time1 to current date
do shell script ("ls -R " & quoted form of thePath)
set time2 to current date
set anNSURL to current application's |NSURL|'s fileURLWithPath:thePath
-- call our handler
my listURL:anNSURL inArray:finalNSArray
-- join the strings in the array, and convert it to an AS string
(finalNSArray's componentsJoinedByString:linefeed) as text
set time3 to current date
return {time2 - time1, time3 - time2}

On my iMac (mid-2011) with 16Gb RAM and an SSD, I get: 

 --> {19, 28}

-- 
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>

 _______________________________________________
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:
    • Yosemite and activate failures
      • From: Ray Robertson <email@hidden>
    • Re: Script that "Tells" Finder just Focuses on Finder instead of running
      • From: Philip Stokes <email@hidden>
References: 
 >Script that "Tells" Finder just Focuses on Finder instead of running (From: Alex Hall <email@hidden>)
 >Re: Script that "Tells" Finder just Focuses on Finder instead of running (From: Deivy Petrescu <email@hidden>)
 >Re: Script that "Tells" Finder just Focuses on Finder instead of running (From: 2551 <email@hidden>)
 >Re: Script that "Tells" Finder just Focuses on Finder instead of running (From: Alex Hall <email@hidden>)
 >Re: Script that "Tells" Finder just Focuses on Finder instead of running (From: Deivy Petrescu <email@hidden>)
 >Re: Script that "Tells" Finder just Focuses on Finder instead of running (From: Shane Stanley <email@hidden>)
 >Re: Script that "Tells" Finder just Focuses on Finder instead of running (From: Deivy Petrescu <email@hidden>)
 >Re: Script that "Tells" Finder just Focuses on Finder instead of running (From: Shane Stanley <email@hidden>)
 >Re: Script that "Tells" Finder just Focuses on Finder instead of running (From: Deivy Petrescu <email@hidden>)
 >Re: Script that "Tells" Finder just Focuses on Finder instead of running (From: Shane Stanley <email@hidden>)
 >Re: Script that "Tells" Finder just Focuses on Finder instead of running (From: Shane Stanley <email@hidden>)
 >Re: Script that "Tells" Finder just Focuses on Finder instead of running (From: Yvan KOENIG <email@hidden>)
 >Re: Script that "Tells" Finder just Focuses on Finder instead of running (From: Shane Stanley <email@hidden>)
 >Re: Script that "Tells" Finder just Focuses on Finder instead of running (From: Yvan KOENIG <email@hidden>)
 >Re: Script that "Tells" Finder just Focuses on Finder instead of running (From: Shane Stanley <email@hidden>)
 >Re: Script that "Tells" Finder just Focuses on Finder instead of running (From: Alex Hall <email@hidden>)
 >Re: Script that "Tells" Finder just Focuses on Finder instead of running (From: 2551 <email@hidden>)

  • Prev by Date: Re: Script that "Tells" Finder just Focuses on Finder instead of running
  • Next by Date: modify http request
  • Previous by thread: Re: Script that "Tells" Finder just Focuses on Finder instead of running
  • Next by thread: Re: Script that "Tells" Finder just Focuses on Finder instead of running
  • Index(es):
    • Date
    • Thread