• 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: Finder Scripting Speed
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Finder Scripting Speed


  • Subject: Re: Finder Scripting Speed
  • From: deivy petrescu <email@hidden>
  • Date: Mon, 1 May 2006 22:57:38 -0400


On May 1, 2006, at 22:35, Richard Patterson wrote:

I have written an AppleScript to recursively look for files in a few nested folders and let me know how many files there are. When I run it on a folder that contains I think 19 folders some of which have 600 files, it takes about 30 seconds to execute. In the handler that recursively looks for files in folders it assumes that any folder which has a file in it rather than another folder is as far down as it needs to go and it just reports the number of items in that folder and adds it to a comma separated list which it puts on the clipboard for Filemaker to paste into a field and use.

It seems that 30 seconds is an extremely long time for something like this and I am wondering if the finder is just slow in executing scripts or if there is some way I can really improve the speed of this.

=======================================
<snip script>

Richard Patterson

Richard:
You might try this, since it is probably faster, although, it might take a while depending on the level of nested folders:


<script>
set the scans_folder to (choose folder with prompt "Pick the folder containing the scans you want to log:")
set folder_record to {}
tell application "Finder"
set allFolders to every folder of entire contents of folder scans_folder
repeat with someFolder in allFolders
set someFolder to contents of someFolder
set ctfls to count of files in someFolder
set end of folder_record to {folder_name:someFolder as string, file_count:ctfls}
end repeat
end tell
folder_record
</script>



Deivy _______________________________________________ Do not post admin requests to the list. They will be ignored. Applescript-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Finder Scripting Speed
      • From: Laine Lee <email@hidden>
    • Permanently deleting items with Finder.
      • From: Jack Crombie <email@hidden>
References: 
 >Finder Scripting Speed (From: Richard Patterson <email@hidden>)

  • Prev by Date: Finder Scripting Speed
  • Next by Date: Re: Update to My Recent Questions
  • Previous by thread: Finder Scripting Speed
  • Next by thread: Permanently deleting items with Finder.
  • Index(es):
    • Date
    • Thread