More information about the script (including how to use it) is available from the above link, and you can also view/use the raw source of the script.
[robg adds: I tested this one, and it works as described...]
|
|
|
I wrote an AppleScript app called lselect that lets you select things in the Finder that match a glob pattern, such as what you would use to list particular files with the ls utility in Terminal. I find it useful when I want to quickly select a large group of files with similar but not identical names that aren't necessarily listed consecutively with any sorted Finder list views. Unlike the Find command, the selected results appear alongside the files that didn't match, making it easy to drag the selection to an application or folder in the same directory.
More information about the script (including how to use it) is available from the above link, and you can also view/use the raw source of the script. [robg adds: I tested this one, and it works as described...]
•
[13,636 views]
Hint Options
Great!
You can place the compiled script in the Finder window toolbar. Only one click away if you need it.
Make complex Finder selections with glob patterns
One minor nit: In addition to the "-d" option to the ls command, it would be a good idea to add "-1" (that's number one with a hyphen in front of it). That ensures that the ls command lists a single item on each line.
Make complex Finder selections with glob patterns
There's no need for the -1, the man page for ls states:
-1 (The numeric digit ``one''.) Force output to be one entry per line. This is the default when output is not to a terminal.
choice of ls arguments
Exactly. In fact, my first draft of the script did use On the other hand, it wouldn't hurt to retain the explicit argument, and it would clarify the intent of the code, so I may include it in any future revisions. In the meantime please do make (and share) any changes you find useful. Thanks!
Great tip!
Really useful -- thx for sharing.
Make complex Finder selections with glob patterns
This should come with the OS.
lselect update for column view compatibility
This should come with the OS. I'm glad you find it useful! BTW, the behaviour is funky when in column view. You're right, it is. I must not use column view too often because I hadn't noticed that before. Finder selections appear to work a little differently in column view. So, I've made a few changes in an attempt to accommodate column view and dubbed it lselect 1.1 (same location as the original hint). It should behave more sensibly in column view (no new windows popping up), but there is one stumper bug: if the last item in lselect's internal list of matches is a directory, its contents column will be revealed and other matches will lose selection. The original version remains available just in case this update causes any other problems.
Make complex Finder selections with glob patterns
I found that this script did not work for me on Leopard if the file selected was not a folder... i got an error "Can't make alias "Powerbook:Users:xxxx:my_file.txt" into type folder."
in order to fix it I changed the following lines: if not (exists folder pwdAlias) then set pwdAlias to (container of pwdAlias) as alias end ifto:
-- this should work, but doesn't
--set {isFolder, fName} to {folder, name} of (info for pwdAlias)
-- hack
try
get folder pwdAlias
set isFolder to true
on error
set isFolder to false
end try
if not (isFolder) then
set pwdAlias to (container of pwdAlias) as alias
end if
Hope that helps somebody. |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.22 seconds |
|