2013-06-05 48 views
10

osx上でブラウザウィンドウ(chrome)を起動する方法をいくつか作成するのは、ウィンドウサイズ、タブなどのような特定のものを作成するのには本当に苦労しています。 IEはとてもシンプルなエクササイズですが、私が最初に認めるのは、マックになると私は大きく苦労します。Chromeを起動するApplescript

ここに私の希望リストがあります。

私はウィンドウを開くことができる必要があります(Chromeでは理想的ですが、サファリ以外のブラウザーは必要ありません)。ステータスバーがなく、URLが指定されたアドレスバーもありません。私はjavaScriptを使用してSafariで何かを管理し、javascriptと 'window.open'を実行してchromeを使用しようとしましたが、これは継続的に失敗しました...

Help!

答えて

23

私はChromeでツールバーを非表示にする方法を見つけることが、これらのスクリプトのような何かをしようとしなかった。

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 
+0

FWIW 'ウィンドウを伝える1セットの境界{に0、22、1440、900} end tell'は、1440x900がデバイスの画面解像度であるため、新しいウィンドウをMacBookの全画面表示に設定します。 –

+0

すてきな答え!ありがとうございました。私は最初の例を使用しました - 単純なもの - クロムでjavascriptを実行する。ありがとう! – nurxyz

関連する問題