• 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
JavaScript for Automation curiosity (was "Script that "Tells" Finder just Focuses on Finder instead of running")
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

JavaScript for Automation curiosity (was "Script that "Tells" Finder just Focuses on Finder instead of running")


  • Subject: JavaScript for Automation curiosity (was "Script that "Tells" Finder just Focuses on Finder instead of running")
  • From: 2551 <email@hidden>
  • Date: Mon, 05 Jan 2015 18:12:43 +0700

> On 4 Jan 2015, at 22:00, 2551 <email@hidden> wrote:
>
> If the former is wanted, I'd suggest going into Cocoa and using the NSFileManager Foundation class (it might be interesting to play around with that using JSA).


Branching from Alex's thread about recursively enumerating a folder, I thought I'd see if I could do this with Cocoa and JavaScript for Automation. Here's what I came up with:


var filePath = Path('/Users/sphil'); //my home directory
var fm = $.NSFileManager.defaultManager;
var contents = $.NSArray.alloc.init;
contents = fm.subpathsOfDirectoryAtPathError(filePath.toString(), $());


This works fine for small to medium sized folders. It works on my Downloads folder, which is a couple of levels deep, returning in a few seconds. However,  it totally chokes on my home folder (the script is still running after 2 minutes, which I consider a fail. I never let it run longer than that to see if it would ever complete).

I'm curious to know why that should be the case, and whether others get the same "small success / large fail" effect.


Best


Phil



 _______________________________________________
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: JavaScript for Automation curiosity (was "Script that "Tells" Finder just Focuses on Finder instead of running")
      • From: Shane Stanley <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: 2551 <email@hidden>)

  • Prev by Date: Need helps with my script
  • Next by Date: Re: Need helps with my script
  • Previous by thread: Re: Script that "Tells" Finder just Focuses on Finder instead of running
  • Next by thread: Re: JavaScript for Automation curiosity (was "Script that "Tells" Finder just Focuses on Finder instead of running")
  • Index(es):
    • Date
    • Thread