views:

55

answers:

2

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 files, 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.

+1  A: 

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.

Jeremy Cantrell
+1  A: 

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
mcgrailm
Hmm. Does "entire contents of folder" return a list of aliases?
Jeremy Cantrell
yes I believe that is true
mcgrailm
@Jeremy Cantrell did this help ?
mcgrailm