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

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

问题描述

我怎样才能打开Finder的AppleScript的一个新窗口?我使用的是如果else语句打开一个窗口。我尝试过的 Osascript 命令,但它给了我一个语法错误。在code是如下:

 如果结果返回的按钮是睡眠,那么
    告诉应用程序发现者去睡觉
如果结果的返回按钮打开Finder,然后
    osascript -e'告诉应用程序发现者打开新窗口
其他
    对话框显示当前时间
万一


解决方案

尝试:

 告诉应用程序发现者作出新的Finder窗口

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

解决方案

Try:

tell application "Finder" to make new Finder window

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

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