Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 44 lines (33 sloc) 851 Bytes
# select files and directories (like "open", except that it selects its arguments,
# instead of opening them).
# $ select *.jpg
if [ $# == 0 ]; then
echo "usage: $(basename $0) args"
# NOTE: Remove redirect when debugging!
/usr/bin/osascript - "$@" << END 2>&1 | grep -v CFURLGetFSRef
on run argv
set errorString to ""
set fileList to {}
repeat with s in argv
set end of fileList to (alias (POSIX file s))
on error
# Patterned after the "open" error message
set errorString to errorString & "The file " & s & " does not exist."
end try
end repeat
if not fileList = {}
tell application "Finder"
reveal fileList
end tell
end if
if not errorString = ""
return errorString
end if
end run
You can’t perform that action at this time.