使用 AppleScript 打开新的 Finder 窗口 [英] Open new Finder window using AppleScript

查看:51
本文介绍了使用 AppleScript 打开新的 Finder 窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

How can I open a new window of Finder in AppleScript? I am using an if else statement to open a window. I tried an Osascript command but it gave me a syntax error. The code is below:

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

推荐答案

尝试:

tell application "Finder" to make new Finder window

这篇关于使用 AppleScript 打开新的 Finder 窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆