我需要一个AppleScript来全屏打开safari,以隐藏小牛的工具栏

时间:2014-04-02 04:41:13

标签: safari applescript osx-mavericks

我需要一个AppleScript才能全屏打开safari,以隐藏小牛的工具栏。

这听起来很容易,但它不是!

我需要打开safari然后以全屏模式打开谷歌然后隐藏工具栏。

它将与下面的样本等效,而是用于safari

告诉应用程序" Google Chrome"     开放地点" http://internet.ceo.wa.edu.au/Pages/default.aspx" 结束告诉

告诉应用程序" Google Chrome"激活 告诉应用程序"系统事件"     击键" f"使用{command down,shift down} 结束告诉

2 个答案:

答案 0 :(得分:2)

可能很简单:

tell application "Safari"
    activate

    if (count of windows) is 0 then -- Remove "if" statement if you don't want to make a new window if there is none
        make new document at front
    end if
    tell application "System Events" to keystroke "f" using {command down, control down}
end tell

不确定是否可以在没有工具栏的情况下制作它。

更新4/4

不确定你能用它做什么但是看看这个程序。如果它以你想要的方式工作。添加系统事件以使用下拉菜单选择项目。

Barbarian Group有一个名为" Plainview"的免费应用程序,它似乎只是Webkit的一个包装器。它可以作为"全屏自助服务终端风格的演示内容查看器",类似于Chrome演示模式。

无论如何,它是免费下载的,因此没有尝试的风险。滚动几乎到此页面的底部: http://barbariangroup.com

直接下载: http://s3.amazonaws.com/plainviewapp/plainview_1.0.178.zip

答案 1 :(得分:0)

简单方法:

将MyApps设置为{" Google Chrome"," Skype"," Finder"}

在MyApps中重复MyApp

tell application MyApp

    activate

    delay 3

    tell application "System Events" to tell process MyApp

        set value of attribute "AXFullScreen" of window 1 to true

    end tell

end tell

结束重复