通过applescript在finder中打开信息窗口

通过applescript在finder中打开信息窗口,applescript,finder,Applescript,Finder,要找到正确的apple脚本命令,我有一些问题:我想打开给定文件或文件夹的信息窗口。这是一个我可以在Finder中通过cmd+I打开的窗口。现在,我希望能够通过脚本文件自动执行此操作。 我的代码实际上如下所示: set aFile to POSIX file "/Users/xyz/Documents/test.rtf" tell application "Finder" to open information window of aFile 但这不起作用。错误消息表示无法打开文件“Macint

要找到正确的apple脚本命令,我有一些问题:我想打开给定文件或文件夹的信息窗口。这是一个我可以在Finder中通过cmd+I打开的窗口。现在,我希望能够通过脚本文件自动执行此操作。 我的代码实际上如下所示:

set aFile to POSIX file "/Users/xyz/Documents/test.rtf"
tell application "Finder" to open information window of aFile

但这不起作用。错误消息表示无法打开文件“Macintosh HD的信息窗口:用户:xyz:文档:test.rtf”。

某些命令对posix文件很挑剔。所以我们可以强迫它去做别的事情,它会起作用的

set aFile to (POSIX file "/Users/xyz/Documents/test.rtf") as alias
tell application "Finder" to open information window of aFile


有些命令对posix文件很挑剔。所以我们可以强迫它去做别的事情,它会起作用的

set aFile to (POSIX file "/Users/xyz/Documents/test.rtf") as alias
tell application "Finder" to open information window of aFile