【问题标题】:Open info window in finder by applescript通过applescript在finder中打开信息窗口
【发布时间】:2014-06-26 03:15:13
【问题描述】:

我在查找正确的苹果脚本命令时遇到了一些问题:我想打开给定文件或文件夹的信息窗口。这是我可以在 Finder 中通过 cmd+i 打开的窗口。现在我希望能够通过脚本文件自动执行此操作。 我的代码实际上是这样的:

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

但这不起作用。错误信息说“Macintosh HD 信息窗口:Users:xyz:Documents:test.rtf”文件无法打开。

【问题讨论】:

    标签: applescript finder


    【解决方案1】:

    有些命令对 posix 文件很挑剔。所以我们可以把它强制到别的东西上,它会起作用......

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-03-16
      • 1970-01-01
      • 2019-10-30
      • 2013-11-03
      • 1970-01-01
      • 2012-06-30
      • 1970-01-01
      相关资源
      最近更新 更多