How to tell Finder to select/reveal multiple files in AppleScript
Using the following code:
tell application "Finder" to reveal every item of theFiles
Works when theFiles contains a single file, but when it contains multiple f开发者_运维百科iles, I get:
error "Finder got an error: AppleEvent handler failed." number -10000
What am I doing wrong? I simply want to highlight a list of files in Finder.
This seems to work:
tell application "Finder" to reveal theFiles
An example I was looking at shows "... reveal every item of ...". I'm not sure if they're in error or something changed with AS.
this seems to work fine
tell application "Finder"
set theFiles to entire contents of folder of (choose folder)
reveal every item of theFiles
end tell
精彩评论