使用AppleScript打开新的查找器窗口

使用AppleScript打开新的查找器窗口,applescript,Applescript,如何在AppleScript中打开Finder的新窗口?我正在使用if-else语句打开窗口。我尝试了一个Osascript命令,但它给了我一个语法错误。代码如下: if the button returned of the result is "Sleep" then tell app "Finder" to go to sleep if the button returned of the result is "Open Finder" then osascript -e '

如何在AppleScript中打开Finder的新窗口?我正在使用if-else语句打开窗口。我尝试了一个
Osascript
命令,但它给了我一个语法错误。代码如下:

if the button returned of the result is "Sleep" then
    tell app "Finder" to go to sleep
if the button returned of the result is "Open Finder" then
    osascript -e 'tell application "Finder" to open new window'
else
    display dialog current time
end if
尝试:


我的Alfred工作流脚本:

论阿尔弗雷德·吴剧本(q)


结束alfred_脚本

做得很好;从OSX 10.11.4开始,有两个怪癖。(a) 奇怪的是,以这种方式创建的窗口不会显示在
窗口
菜单中。(b) 无论Finder的首选项中配置了什么,新窗口的
目标(即位置)始终是整个计算机的设备视图。此外,似乎忽略了属性{target:…}
——您知道指定目标位置的方法吗(除了稍后设置它,这会造成视觉上的破坏)?
tell application "Finder" to make new Finder window
tell application "Finder"
    make new Finder window
end tell