Re: Getting list of items from network slow
Re: Getting list of items from network slow
- Subject: Re: Getting list of items from network slow
- From: Jim Skibbie <email@hidden>
- Date: Sun, 23 Nov 2008 15:39:07 -0600
- Thread-topic: Getting list of items from network slow
Title: Re: Getting list of items from network slow
Brian-
You are not alone. I try to avoid scripting the Finder whenever possible. On remote mounted volumes, I’ve gotten sporadic errors with snippets like the one you show where sometimes it will work and sometimes it will error with a “Finder can’t get every item of thefolder”. There seems to be no rhyme or reason. The bigger or more complicated the directory, the shakier it gets. I usually go with something like this instead:
set theFolder to POSIX path of (choose folder)
set theList to every paragraph of (do shell script "ls " & quoted form of theFolder)
Depending on what you want to do from here, you’ll have to do some concatenating of the resulting list with “theFolder” if you want to, perhaps, coerce the result back into an alias.
Maybe Apple’s rewrite of Finder under Snow Leopard will make it an application you can depend on.
Jim
Date: Sat, 22 Nov 2008 04:50:45 -0500
From: brian mather <email@hidden>
Subject: Getting list of items from network slow
To: <email@hidden>
Message-ID: <C54D4025.2F1D%email@hidden">C54D4025.2F1D%email@hidden>
Content-Type: text/plain; charset="US-ASCII"
Am I alone in enjoying ridiculously horrible network latency when querying a
folder on a SMB volume for it's contents with a Mac running 10.5.5?
tell application "Finder"
set thefolder to choose folder
set theFiles to every item of thefolder
--return theFiles
end tell
When I choose a volume local to my Mac this snippet returns results like
lightning. Choose a folder on my network and it takes nearly two minutes.
Discovered this as I was testing all of my department's scripts for a
transition from 10.4 to 10.5. Similarly poor results on MacPros and G5s so
hardware doesn't seem to be a large contributing factor.
I've googled this a bit and checked the list archive without much luck. I've
seen vague references to others suffering this same issue and was hoping for
a leg up. Is there a better method to get a list of files that I can iterate
through with repeat loops? Should this not be in a tell finder block? Should
I get 'files' and not 'items'?
Any help appreciated. I'm on digest so cc'ing back to me directly much
appreciated.
Brian
_______________________________________________
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