2010-06-25 78 views
2

选择/显示多个文件使用下面的代码:如何判断搜索器的AppleScript

tell application "Finder" to reveal every item of theFiles 

作品时theFiles包含一个文件,但是当它包含多个文件,我得到:

error "Finder got an error: AppleEvent handler failed." number -10000 

我做错了什么?我只想突出显示Finder中的文件列表。

+0

哪里thefiles被定义? – mcgrailm 2010-06-25 12:55:10

+0

它们作为posix路径启动并转换为别名。 – 2010-06-25 14:58:25

+0

我可以看到使别名 – mcgrailm 2010-06-25 15:13:42

回答

2

这似乎工作:

tell application "Finder" to reveal theFiles 

我一直在寻找展示了一个例子“...揭示的每一个项目......”。我不确定他们是否出现错误或者是因为AS而改变了。

1

这似乎很好地工作

tell application "Finder" 
    set theFiles to entire contents of folder of (choose folder) 
    reveal every item of theFiles 
    end tell 
+0

嗯的代码。 “文件夹的全部内容”是否返回别名列表? – 2010-06-25 14:57:30

+0

是的,我相信这是真的 – mcgrailm 2010-06-25 15:13:00

+0

@Jeremy Cantrell做了这个帮助吗? – mcgrailm 2010-06-28 12:53:38