使用AppleScript打开新的Finder窗口

时间:2014-01-17 14:37:09

标签: 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 'tell application "Finder" to open new window'
else
    display dialog current time
end if

2 个答案:

答案 0 :(得分:7)

尝试:

tell application "Finder" to make new Finder window

答案 1 :(得分:-2)

我的Alfred Workflow脚本:

关于alfred_script(q)

tell application "Finder"
    make new Finder window
end tell

结束alfred_script