0

我在一个更大的脚本中有以下片段:

--I think this should work…
--make new Finder window with properties {target:theWallpaperPosixFile}
set theWindow to make new Finder window
set target of theWindow to theWallpaperPosixFile

当我认为注释掉的行在功能上应该与底线相同时,为什么它不起作用?

编辑:要清楚,代码按原样工作。我错过了一些关于with properties. 我从这个以及许多其他网站和 Finder 词典的理解是 2 班轮应该等同于 1 班轮。但事实并非如此。它只是弹出一个没有目标的新 Finder 窗口。

所以我的问题是具体如何使用with properties,而不是“如何使其工作”。

4

1 回答 1

2

尝试:

set wallpaperPaths to {POSIX path of (path to documents folder)} -- Example

repeat with wallpaperPath in wallpaperPaths
    set theWallpaperPosixFile to POSIX file (contents of wallpaperPath) as alias
    tell application "Finder" to set theWindow to make new Finder window to theWallpaperPosixFile
end repeat

编辑

在字典中查找标准套件中的 Make:

在此处输入图像描述

于 2013-05-29T13:05:01.250 回答