Re: Can I Speed Up This Folder Browsing Script?
Re: Can I Speed Up This Folder Browsing Script?
- Subject: Re: Can I Speed Up This Folder Browsing Script?
- From: Christopher Nebel <email@hidden>
- Date: Tue, 9 Nov 2004 14:46:32 -0800
On Nov 9, 2004, at 12:26 PM, Mr Tea wrote:
I've always found browsing through lots of adjacent folders a bit of a
bore,
constantly navigating back up into the parent folder, then down into
the
next folder along. This script makes the Finder's front window skip
straight
to the next folder without all that nonsense, but it's a wee bit
sluggish.
Not disastrously so, but I just feel it could be snappier.
If anyone here can help me get a speed boost, I'd be most gratefully
indebted. I'm interested mainly in how to get the best performance with
vanilla applescript, but I'd also be interested in shell script
methods, and
in altenatives that use popular scripting additions like the excellent
Satimage OSAX.
Here's my effort...
--=====================================
tell application "Finder"
set YouAreHere to target of Finder window 1
set Daddy to container of YouAreHere
set siblings to every folder of Daddy
repeat with i from 1 to count of siblings
set aSibling to item i of siblings
if aSibling is YouAreHere then
try
set target of Finder window 1 to item (i + 1) of siblings
on error
set target of Finder window 1 to Daddy
end try
exit repeat
end if
end repeat
end tell
--=====================================
Naturally, there's also a 'go to previous subfolder' version.
Relative addressing is your friend:
tell application "Finder"
tell Finder window 1
set YouAreHere to target
try
set target to folder after YouAreHere -- use "before" to go
backwards.
on error
set target to container of YouAreHere
end try
end tell
end
--Chris Nebel
AppleScript Engineering
_______________________________________________
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