的AppleScript将推出Chrome浏览器(带细节) [英] Applescript to Launch Chrome (with specifics)

查看:902
本文介绍了的AppleScript将推出Chrome浏览器(带细节)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我真的与创建OSX上启动一个浏览器窗口(铬)与细节,如窗口大小的方法有些挣扎,没有标签等传统上,我通过与IE窗口使用VB脚本这是一个pretty简单的练习,但我会第一个承认,当涉及到Mac上我挣扎很大。

I'm really struggling with creating some method of launching a browser window (chrome) on osx with specifics such as window size, no tabs etc. Traditionally I've used vb script through windows with IE which is a pretty simple exercise but I'll be the first to admit, when it comes to macs I struggle greatly.

因此​​,这里是我的愿望清单。

So here is my wish list.

我需要能够打开一个窗口(最好在铬,但是除了Safari浏览器的任何其他浏览器),一个没有状态栏,与给定的URL地址没有酒吧,和一个特定的窗口大小。我没有使用管理做的JavaScript Safari浏览器的东西,并试图用镀铬与使用执行JavaScript和window.open但这未能持续...

I need to be able to open a window (ideally in chrome, but any other browser except safari), that has no status bar, no address bar with a given URL, and a specific window size. I did manage something in safari using do javaScript, and attempted the same with chrome using execute javascript and 'window.open' but this failed continually...

帮助!

推荐答案

我没有找到任何方法来隐藏在Chrome工具栏上,但你可以试试这些脚本:

I didn't find any way to hide the toolbar in Chrome, but try something like these scripts:

tell application "Google Chrome"
    open location "http://example.com"
    tell window 1 to enter presentation mode
end tell

tell application "Google Chrome"
    tell (make new window)
        set URL of active tab to "http://example.com"
        set bounds to {0, 22, 1200, 900}
    end tell
    activate
end tell

tell application "Safari"
    make new document with properties {URL:"http://example.com"}
    tell window 1
        set bounds to {0, 22, 1200, 900}
    end tell
    activate
end tell
tell application "System Events" to tell process "Safari"
    tell menu "View" of menu bar 1
        if exists menu item "Hide Toolbar" then click menu item "Hide Toolbar"
        if exists menu item "Hide Status Bar" then click menu item "Hide Status Bar"
        if exists menu item "Hide Tab Bar" then click menu item "Hide Tab Bar"
        if exists menu item "Hide Bookmarks Bar" then click menu item "Hide Bookmarks Bar"
    end tell
end tell

这篇关于的AppleScript将推出Chrome浏览器(带细节)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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