23

MacBook をデスクから離れた場所で使用し、後でそれを外部ディスプレイに (プライマリとして) 接続すると、ノートブック モニターと外部モニターの両方にウィンドウが配置された状態になります。

すべてのウィンドウを 1 つの画面に移動するには、私の現在の解決策は、ディスプレイの設定で「ミラーリングをオンにする」ことです。ただし、これはかなり面倒です。誰かがより良い方法を知っていますか?


残念ながら、@ erlandoが投稿したスクリプトは、Mac OS X 10.5.4 を実行している私にはまったく役に立ちません。(つまり、両方の画面にウィンドウがある場合、スクリプトを実行しても、そのうちの 1 つが動かず、エラーは返されません。) 上記の「ミラーリング/ミラーリング解除」メソッドを使い続ける必要があると思います。


@ Denton : これらのリンクには画面から切り離されたウィンドウをディスプレイに戻すためのスクリプトが含まれていると思います。すべてのウィンドウをセカンダリ ディスプレイからプライマリ ディスプレイに移動したいだけです。

4

6 に答える 6

25

Cmd+F1Snow Leopard のミラー ディスプレイのショートカットのようです。ライオンなどは知りませんが。

2回タップして、何が起こるか見てみましょう(-:

ファンクションキーを昔ながらの方法で(明るさ/サウンドコントロールなどではなく)動作するように設定することを好む人のために、それはCmd+Fn+F1

于 2012-07-08T02:50:07.580 に答える
8

fnLion では、 + Cmd+を使用してミラー ディスプレイを切り替えることができますF1(デフォルトでメディア コントロール キーを使用している場合)。

これは、Snow Leopard とその中間のすべてで機能し、さらに遡ることもできます。

于 2012-05-02T10:29:44.390 に答える
4

「ディスプレイ」環境設定ペインで「ウィンドウを収集」ボタンをクリックできます。

于 2008-09-16T18:29:58.340 に答える
3

あなたが言ったように、最良の答えは「ミラーディスプレイ」をオンまたはオフにすることのようです。その後、すべてのウィンドウがメイン画面に集められ、セカンダリ画面は空になります。

スクリーンショット

これは少し面倒ですが、Lion でうまくいったことは他にありません。

于 2012-04-24T18:05:37.273 に答える
3

これを行うためのコマンドライン スクリプトを次に示します: http://zach.in.tu-clausthal.de/software/

「画面外のウィンドウをメイン画面に移動」の下のページの少し下にあります。


-- Source: http://www.jonathanlaliberte.com/2007/10/19/move-all-windows-to-your-main-screen/
-- and: http://www.macosxhints.com/article.php?story=2007102012424539
--
-- Improvements:
-- +  code is more efficient and more elegant now
-- + windows are moved also, if they are "almost" completely off-screen 
--      (in the orig. version, they would be moved only if they were completely off-screen)
-- + windows are moved (if they are moved) to their closest position on-screen
--     (in the orig. version, they would be moved to a "home position" (0,22) )
-- Gabriel Zachmann, Jan 2008

-- Example list of processes to ignore: {"xGestures"} or {"xGestures", "OtherApp", ...}
property processesToIgnore : {"Typinator"}

-- Get the size of the Display(s), only useful if there is one display
-- otherwise it will grab the total size of both displays
tell application "Finder"
    set _b to bounds of window of desktop
    set screen_width to item 3 of _b
    set screen_height to item 4 of _b
end tell

tell application "System Events"
    set allProcesses to application processes
    repeat with i from 1 to count allProcesses
        --display dialog (name of (process i)) as string
        if not (processesToIgnore contains ((name of (process i)) as string)) then
            try
                tell process i
                    repeat with x from 1 to (count windows)
                        set winPos to position of window x
                        set _x to item 1 of winPos
                        set _y to item 2 of winPos
                        set winSize to size of window x
                        set _w to item 1 of winSize
                        set _h to item 2 of winSize
                        --display dialog (name as string) & " - width: " & (_w as string) & " height: " & (_h as string)
                        
                        if (_x + _w < 40 or _y + _h < 50 or _x > screen_width - 40 or _y > screen_height - 40) then
                            
                            if (_x + _w < 40) then set _x to 0
                            if (_y + _h < 50) then set _y to 22
                            if (_x > screen_width - 40) then
                                set _x to screen_width - _w
                                if (_x < 0) then set _x to 0
                            end if
                            if (_y > screen_height - 40) then
                                set _y to screen_height - _h
                                if (_y < 22) then set _y to 22
                            end if
                            set position of window x to {_x, _y}
                            
                        end if
                    end repeat
                    
                end tell
            end try
        end if
    end repeat
end tell
于 2008-09-02T09:33:30.700 に答える
2

これを行うための AppleScript の使用に関する記事がmacosxtips.co.ukにあり、別の記事がmacosxhints.comにあります。

于 2008-09-06T03:37:55.587 に答える