Quick search through large number of folders
Quick search through large number of folders
- Subject: Quick search through large number of folders
- From: Brett Conlon <email@hidden>
- Date: Fri, 18 Aug 2006 19:40:15 +1100
Hi all,
I have a network volume with over 16,000 folders in it - same level (part
of our Pre-Press archive system). Using Sherlock to search for specific
folder names (eg. D44321) was taking too long (probably because it was
looking into the entire contents of every folder too) so I thought I could
write a quick AppleScript that would look at the top level only.
Initially I wrote it to process every item one at a time and compare its
name to a user entered prompt value but then (after running it seemed very
slow) I though it may be much faster if the script create a huge text list
from the names of these folders and then compared the user entry to the
list - then if a match is found it would stitch the directory back
together and select it in the finder.
This is what I wrote (which seems to work):
on run
tell application "Finder"
set myList to choose folder with prompt "Choose folder to
search."
set itemlist to name of every folder of myList as list
set myCount to count of itemlist
set DNum to text returned of (display dialog "Please enter
a D*Number (eg. D12345):" buttons {"OK"} default button 1 default answer
"")
repeat with i in itemlist
if i is equal to DNum then
beep
try
set myTarget to ((myList) as text)
& i
tell folder myTarget to select
end try
end if
end repeat
end tell
display dialog "All finished!" buttons {"OK"} default button 1
end run
Should I stick with Sherlock and put this down to another exercise in
writing AppleScripts?
Cheers,
Cojcolds
_______________________________________________
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