C'è una scorciatoia da tastiera per organizzare o allineare due finestre di ricerca?

2

So che c'erano alcune app di terze parti che potevano farlo in passato, ma con ogni nuova versione di Mac OS X, sembra che molte di quelle app di terze parti smettono di funzionare o il progetto invecchia e perde il suo manutentore.

Mi chiedo se ci sia una scorciatoia da tastiera integrata in Mac OS X per farlo. Suppongo che questo non sarebbe limitato alle finestre di ricerca, ma per Windows di qualsiasi applicazione.

    
posta David Killingsworth 12.07.2018 - 19:27
fonte

2 risposte

1

Per quanto ne so, non esiste un modo "out of the box" o una scorciatoia di sistema, per poter allineare o organizzare le finestre del Finder. Tuttavia, utilizzando Script Editor.app per creare un AppleScript per impostare i limiti (dimensione e posizione) delle finestre del Finder, puoi quindi portare il codice AppleScript finito in Automator.app creando un nuovo documento in Automator e selezionando "Servizio" come il nuovo tipo di documento.

Ilprossimopassosarebbeaggiungereun'azioneAppleScriptdiesecuzionealflussodilavoro,quindiincollareilgiàcitatoAppleScript,cheabbiamocompilatoinScriptEditor.app,nell'esecuzionedell'AzionediAppleScriptinAutomator

Successivamente,salvereiechiameraiilservizioAutomator(l'hochiamato"Disponi Finder Windows"). Dopodiché, il tuo nuovo servizio sarà disponibile nelle preferenze di sistema, a quel punto potrai assegnargli una scorciatoia da tastiera.

Oradiamoun'occhiataalprocessocoinvoltonellacreazionedelloscriptinScriptEditor.app,permanipolarelefinestredelFinder.UsandoilmioMacBookProda15", ho 5 risoluzioni di visualizzazione diverse tra le quali posso scegliere. Quello che sto ottenendo è che, se la mia risoluzione corrente è impostata su" Default ", qualunque codice creo che manipolerà le finestre del Finder, funzionerà correttamente solo quando sto usando la risoluzione di visualizzazione predefinita. In un secondo momento, se decido di cambiare il mio Display più in alto o in basso, il codice che ho creato mentre uso il display predefinito, posizionerà effettivamente le finestre del Finder in posizioni diverse così come erano originariamente significato.

In breve, l'obiettivo qui è essere in grado di allineare e disporre le finestre del Finder (elaborazione da un massimo di sei finestre) indipendentemente dalla risoluzione di visualizzazione attualmente in uso.

Questaprimapartedelseguentecodiceimpostaivaloridelleproprietàpertutteecinquelediverserisoluzionidelloschermochepossosceglierenellepreferenzedisistema

--ALLPOSSIBLEDISPLAYRESOLUTIONVALUESINSYSTEMPREFERENCES--propertydisplayRezolution_Lowest:{0,0,1024,640}propertydisplayRezolution_Lower:{0,0,1280,800}propertydisplayRezolution_Default:{0,0,1440,900}propertydisplayRezolution_Higher:{0,0,1680,1050}propertydisplayRezolution_Highest:{0,0,1920,1200}

Questosnippetdicodicesuccessivorecupereràlarisoluzioneeffettivadeldisplayattualmenteinusosulmonitor

--GETSTHECURRENTDISPLAYRESOLUTIONBEINGUSED--tellapplication"Finder" to set getRezolution to get bounds of window of desktop

Questo snippet successivo determina quale oggetto script deve essere eseguito in base alla risoluzione di visualizzazione corrente. (Ho creato cinque diversi oggetti script, uno script per ogni risoluzione dello schermo ... ognuno dei quali contiene valori diversi per i limiti delle finestre del finder

-- DETERMINES WHICH SCRIPT TO RUN BASED ON THE CURRENT DISPLAY RESOLUTION --
if getRezolution is equal to displayRezolution_Lowest then
    run script displayRezolutionLowest
else if getRezolution is equal to displayRezolution_Lower then
    run script displayRezolutionLower
else if getRezolution is equal to displayRezolution_Default then
    run script displayRezolutionDefault
else if getRezolution is equal to displayRezolution_Higher then
    run script displayRezolutionHigher
else if getRezolution is equal to displayRezolution_Highest then
    run script displayRezolutionHighest
end if

Ecco lo script completo che verrà inserito in Automator

-- ALL POSSIBLE DISPLAY RESOLUTION VALUES IN SYSTEM PREFERENCES --

property displayRezolution_Lowest : {0, 0, 1024, 640}
property displayRezolution_Lower : {0, 0, 1280, 800}
property displayRezolution_Default : {0, 0, 1440, 900}
property displayRezolution_Higher : {0, 0, 1680, 1050}
property displayRezolution_Highest : {0, 0, 1920, 1200}

-- GETS THE CURRENT DISPLAY RESOLUTION BEING USED --

tell application "Finder" to set getRezolution to get bounds of window of desktop

-- DETERMINES WHICH SCRIPT TO RUN BASED ON THE CURRENT DISPLAY RESOLUTION --

if getRezolution is equal to displayRezolution_Lowest then
    run script displayRezolutionLowest
else if getRezolution is equal to displayRezolution_Lower then
    run script displayRezolutionLower
else if getRezolution is equal to displayRezolution_Default then
    run script displayRezolutionDefault
else if getRezolution is equal to displayRezolution_Higher then
    run script displayRezolutionHigher
else if getRezolution is equal to displayRezolution_Highest then
    run script displayRezolutionHighest
end if

--  INDIVIDUAL SCRIPT OBJECTS   --

script displayRezolutionLowest
    property savedBoundz6 : {{0, 22, 479, 456}, {480, 22, 959, 456}, {961, 22, 1440, 456}, ¬
        {0, 458, 479, 892}, {480, 457, 959, 891}, {961, 457, 1440, 891}}
    property savedBoundz5 : {{0, 22, 479, 456}, {480, 22, 959, 456}, {961, 22, 1440, 456}, ¬
        {0, 458, 479, 892}, {480, 457, 1440, 891}}
    property savedBoundz4 : {{0, 22, 517, 366}, {518, 22, 1024, 366}, ¬
        {0, 294, 517, 638}, {518, 295, 1024, 639}}
    property savedBoundz3 : {{0, 22, 342, 640}, {343, 22, 684, 640}, {685, 22, 1024, 640}}
    property savedBoundz2 : {{0, 22, 517, 640}, {518, 22, 1024, 640}}

    tell application "Finder"
        if (count of every window) = 6 then
            set theBoundz to savedBoundz6
            repeat with theWindow from 1 to count of theBoundz
                set theItem to item theWindow of theBoundz
                try
                    set the bounds of Finder window theWindow to theItem
                end try
                delay 0.1
            end repeat
        else if (count of every window) = 5 then
            set theBoundz to savedBoundz5
            repeat with theWindow from 1 to count of theBoundz
                set theItem to item theWindow of theBoundz
                try
                    set the bounds of Finder window theWindow to theItem
                end try
                delay 0.1
            end repeat
        else if (count of every window) = 4 then
            set theBoundz to savedBoundz4
            repeat with theWindow from 1 to count of theBoundz
                set theItem to item theWindow of theBoundz
                try
                    set the bounds of Finder window theWindow to theItem
                end try
                delay 0.1
            end repeat
        else if (count of every window) = 3 then
            set theBoundz to savedBoundz3
            repeat with theWindow from 1 to count of theBoundz
                set theItem to item theWindow of theBoundz
                try
                    set the bounds of Finder window theWindow to theItem
                end try
                delay 0.1
            end repeat
        else if (count of every window) = 2 then
            set theBoundz to savedBoundz2
            repeat with theWindow from 1 to count of theBoundz
                set theItem to item theWindow of theBoundz
                try
                    set the bounds of Finder window theWindow to theItem
                end try
                delay 0.1
            end repeat
        else if (count of every window) = 1 then
            run script centerWindow
        else if (count of every window) = 0 then
            return
        else if (count of every window) is greater than 6 then
            return
        end if
    end tell

    script centerWindow
        property sidebarWidth : 259
        property theBoundz : missing value
        property theBoundz_1 : {163, 76, 876, 547}
        property theBoundz_2 : {260, 119, 1060, 652}
        property theBoundz_3 : {305, 73, 1126, 812}
        property theBoundz_4 : {353, 122, 1324, 868}
        property theBoundz_5 : {466, 201, 1467, 1129}

        property displayRezolution_Lowest : {0, 0, 1024, 640}
        property displayRezolution_Lower : {0, 0, 1280, 800}
        property displayRezolution_Default : {0, 0, 1440, 900}
        property displayRezolution_Higher : {0, 0, 1680, 1050}
        property displayRezolution_Highest : {0, 0, 1920, 1200}

        tell application "Finder" to set getRez to get bounds of window of desktop

        if displayRezolution_Lowest is equal to getRez then
            centerFinderWindow(theBoundz_1)
        end if
        if displayRezolution_Lower is equal to getRez then
            centerFinderWindow(theBoundz_2)
        end if
        if displayRezolution_Default is equal to getRez then
            centerFinderWindow(theBoundz_3)
        end if
        if displayRezolution_Higher is equal to getRez then
            centerFinderWindow(theBoundz_4)
        end if
        if displayRezolution_Highest is equal to getRez then
            centerFinderWindow(theBoundz_5)
        end if

        on centerFinderWindow(theBoundz)
            tell application "Finder"
                try
                    tell its Finder windows
                        set its current view to column view
                        set its bounds to theBoundz
                        delay 0.1
                        set its sidebar width to sidebarWidth
                        delay 0.1
                        set its toolbar visible to true
                        delay 0.1
                    end tell
                    tell its Finder windows
                        set its sidebar width to sidebarWidth
                    end tell
                end try
            end tell
        end centerFinderWindow
    end script
end script

script displayRezolutionLower
    property savedBoundz6 : {{438, 410, 879, 800}, {0, 22, 437, 409}, {438, 22, 879, 409}, ¬
        {1, 410, 437, 800}, {880, 22, 1280, 409}, {880, 410, 1280, 800}}
    property savedBoundz5 : {{657, 410, 1280, 800}, {0, 22, 437, 409}, ¬
        {438, 22, 879, 409}, {1, 410, 656, 800}, {880, 22, 1280, 409}}
    property savedBoundz4 : {{657, 410, 1280, 800}, {0, 22, 656, 409}, {657, 22, 1280, 409}, ¬
        {1, 410, 656, 800}}
    property savedBoundz3 : {{846, 22, 1280, 800}, {407, 22, 845, 800}, {0, 22, 406, 800}}
    property savedBoundz2 : {{648, 22, 1280, 800}, {0, 22, 647, 800}}

    tell application "Finder"
        if (count of every window) = 6 then
            set theBoundz to savedBoundz6
            repeat with theWindow from 1 to count of theBoundz
                set theItem to item theWindow of theBoundz
                try
                    set the bounds of Finder window theWindow to theItem
                end try
                delay 0.1
            end repeat
        else if (count of every window) = 5 then
            set theBoundz to savedBoundz5
            repeat with theWindow from 1 to count of theBoundz
                set theItem to item theWindow of theBoundz
                try
                    set the bounds of Finder window theWindow to theItem
                end try
                delay 0.1
            end repeat
        else if (count of every window) = 4 then
            set theBoundz to savedBoundz4
            repeat with theWindow from 1 to count of theBoundz
                set theItem to item theWindow of theBoundz
                try
                    set the bounds of Finder window theWindow to theItem
                end try
                delay 0.1
            end repeat
        else if (count of every window) = 3 then
            set theBoundz to savedBoundz3
            repeat with theWindow from 1 to count of theBoundz
                set theItem to item theWindow of theBoundz
                try
                    set the bounds of Finder window theWindow to theItem
                end try
                delay 0.1
            end repeat
        else if (count of every window) = 2 then
            set theBoundz to savedBoundz2
            repeat with theWindow from 1 to count of theBoundz
                set theItem to item theWindow of theBoundz
                try
                    set the bounds of Finder window theWindow to theItem
                end try
                delay 0.1
            end repeat
        else if (count of every window) = 1 then
            run script centerWindow
        else if (count of every window) = 0 then
            return
        else if (count of every window) is greater than 6 then
            return
        end if
    end tell

    script centerWindow
        property sidebarWidth : 259
        property theBoundz : missing value
        property theBoundz_1 : {163, 76, 876, 547}
        property theBoundz_2 : {260, 119, 1060, 652}
        property theBoundz_3 : {305, 73, 1126, 812}
        property theBoundz_4 : {353, 122, 1324, 868}
        property theBoundz_5 : {466, 201, 1467, 1129}

        property displayRezolution_Lowest : {0, 0, 1024, 640}
        property displayRezolution_Lower : {0, 0, 1280, 800}
        property displayRezolution_Default : {0, 0, 1440, 900}
        property displayRezolution_Higher : {0, 0, 1680, 1050}
        property displayRezolution_Highest : {0, 0, 1920, 1200}

        tell application "Finder" to set getRez to get bounds of window of desktop

        if displayRezolution_Lowest is equal to getRez then
            centerFinderWindow(theBoundz_1)
        end if
        if displayRezolution_Lower is equal to getRez then
            centerFinderWindow(theBoundz_2)
        end if
        if displayRezolution_Default is equal to getRez then
            centerFinderWindow(theBoundz_3)
        end if
        if displayRezolution_Higher is equal to getRez then
            centerFinderWindow(theBoundz_4)
        end if
        if displayRezolution_Highest is equal to getRez then
            centerFinderWindow(theBoundz_5)
        end if

        on centerFinderWindow(theBoundz)
            tell application "Finder"
                try
                    tell its Finder windows
                        set its current view to column view
                        set its bounds to theBoundz
                        delay 0.1
                        set its sidebar width to sidebarWidth
                        delay 0.1
                        set its toolbar visible to true
                        delay 0.1
                    end tell
                    tell its Finder windows
                        set its sidebar width to sidebarWidth
                    end tell
                end try
            end tell
        end centerFinderWindow
    end script
end script

script displayRezolutionDefault
    property savedBoundz6 : {{0, 22, 479, 456}, {480, 22, 959, 456}, {961, 22, 1440, 456}, ¬
        {0, 458, 479, 892}, {480, 457, 959, 891}, {961, 457, 1440, 891}}
    property savedBoundz5 : {{0, 22, 479, 456}, {480, 22, 959, 456}, {961, 22, 1440, 456}, ¬
        {0, 458, 479, 892}, {480, 457, 1440, 891}}
    property savedBoundz4 : {{722, 22, 1440, 456}, {0, 22, 721, 456}, {722, 457, 1440, 900}, ¬
        {0, 458, 721, 900}}
    property savedBoundz3 : {{0, 22, 479, 900}, {480, 22, 959, 900}, {961, 22, 1453, 900}}
    property savedBoundz2 : {{0, 22, 715, 900}, {716, 22, 1438, 900}}

    tell application "Finder"
        if (count of every window) = 6 then
            set theBoundz to savedBoundz6
            repeat with theWindow from 1 to count of theBoundz
                set theItem to item theWindow of theBoundz
                try
                    set the bounds of Finder window theWindow to theItem
                end try
                delay 0.1
            end repeat
        else if (count of every window) = 5 then
            set theBoundz to savedBoundz5
            repeat with theWindow from 1 to count of theBoundz
                set theItem to item theWindow of theBoundz
                try
                    set the bounds of Finder window theWindow to theItem
                end try
                delay 0.1
            end repeat
        else if (count of every window) = 4 then
            set theBoundz to savedBoundz4
            repeat with theWindow from 1 to count of theBoundz
                set theItem to item theWindow of theBoundz
                try
                    set the bounds of Finder window theWindow to theItem
                end try
                delay 0.1
            end repeat
        else if (count of every window) = 3 then
            set theBoundz to savedBoundz3
            repeat with theWindow from 1 to count of theBoundz
                set theItem to item theWindow of theBoundz
                try
                    set the bounds of Finder window theWindow to theItem
                end try
                delay 0.1
            end repeat
        else if (count of every window) = 2 then
            set theBoundz to savedBoundz2
            repeat with theWindow from 1 to count of theBoundz
                set theItem to item theWindow of theBoundz
                try
                    set the bounds of Finder window theWindow to theItem
                end try
                delay 0.1
            end repeat
        else if (count of every window) = 1 then
            run script centerWindow
        else if (count of every window) = 0 then
            return
        else if (count of every window) is greater than 6 then
            return
        end if
    end tell

    script centerWindow
        property sidebarWidth : 259
        property theBoundz : missing value
        property theBoundz_1 : {163, 76, 876, 547}
        property theBoundz_2 : {260, 119, 1060, 652}
        property theBoundz_3 : {305, 73, 1126, 812}
        property theBoundz_4 : {353, 122, 1324, 868}
        property theBoundz_5 : {466, 201, 1467, 1129}

        property displayRezolution_Lowest : {0, 0, 1024, 640}
        property displayRezolution_Lower : {0, 0, 1280, 800}
        property displayRezolution_Default : {0, 0, 1440, 900}
        property displayRezolution_Higher : {0, 0, 1680, 1050}
        property displayRezolution_Highest : {0, 0, 1920, 1200}

        tell application "Finder" to set getRez to get bounds of window of desktop

        if displayRezolution_Lowest is equal to getRez then
            centerFinderWindow(theBoundz_1)
        end if
        if displayRezolution_Lower is equal to getRez then
            centerFinderWindow(theBoundz_2)
        end if
        if displayRezolution_Default is equal to getRez then
            centerFinderWindow(theBoundz_3)
        end if
        if displayRezolution_Higher is equal to getRez then
            centerFinderWindow(theBoundz_4)
        end if
        if displayRezolution_Highest is equal to getRez then
            centerFinderWindow(theBoundz_5)
        end if

        on centerFinderWindow(theBoundz)
            tell application "Finder"
                try
                    tell its Finder windows
                        set its current view to column view
                        set its bounds to theBoundz
                        delay 0.1
                        set its sidebar width to sidebarWidth
                        delay 0.1
                        set its toolbar visible to true
                        delay 0.1
                    end tell
                    tell its Finder windows
                        set its sidebar width to sidebarWidth
                    end tell
                end try
            end tell
        end centerFinderWindow
    end script
end script

script displayRezolutionHigher
    property savedBoundz6 : {{560, 530, 1120, 1050}, {1121, 22, 1680, 529}, {0, 22, 559, 529}, ¬
        {0, 530, 559, 1050}, {1121, 530, 1680, 1050}, {560, 22, 1119, 529}}
    property savedBoundz5 : {{560, 530, 1120, 1050}, {829, 22, 1680, 529}, {0, 22, 828, 529}, ¬
        {0, 530, 559, 1050}, {1121, 530, 1680, 1050}}
    property savedBoundz4 : {{829, 530, 1680, 1050}, {829, 22, 1680, 529}, {0, 22, 828, 529}, ¬
        {0, 530, 828, 1050}}
    property savedBoundz3 : {{1130, 22, 1680, 1050}, {0, 22, 551, 1050}, {552, 22, 1129, 1050}}
    property savedBoundz2 : {{834, 22, 1680, 1050}, {0, 22, 832, 1050}}

    tell application "Finder"
        if (count of every window) = 6 then
            set theBoundz to savedBoundz6
            repeat with theWindow from 1 to count of theBoundz
                set theItem to item theWindow of theBoundz
                try
                    set the bounds of Finder window theWindow to theItem
                end try
                delay 0.1
            end repeat
        else if (count of every window) = 5 then
            set theBoundz to savedBoundz5
            repeat with theWindow from 1 to count of theBoundz
                set theItem to item theWindow of theBoundz
                try
                    set the bounds of Finder window theWindow to theItem
                end try
                delay 0.1
            end repeat
        else if (count of every window) = 4 then
            set theBoundz to savedBoundz4
            repeat with theWindow from 1 to count of theBoundz
                set theItem to item theWindow of theBoundz
                try
                    set the bounds of Finder window theWindow to theItem
                end try
                delay 0.1
            end repeat
        else if (count of every window) = 3 then
            set theBoundz to savedBoundz3
            repeat with theWindow from 1 to count of theBoundz
                set theItem to item theWindow of theBoundz
                try
                    set the bounds of Finder window theWindow to theItem
                end try
                delay 0.1
            end repeat
        else if (count of every window) = 2 then
            set theBoundz to savedBoundz2
            repeat with theWindow from 1 to count of theBoundz
                set theItem to item theWindow of theBoundz
                try
                    set the bounds of Finder window theWindow to theItem
                end try
                delay 0.1
            end repeat
        else if (count of every window) = 1 then
            run script centerWindow
        else if (count of every window) = 0 then
            return
        else if (count of every window) is greater than 6 then
            return
        end if
    end tell

    script centerWindow
        property sidebarWidth : 259
        property theBoundz : missing value
        property theBoundz_1 : {163, 76, 876, 547}
        property theBoundz_2 : {260, 119, 1060, 652}
        property theBoundz_3 : {305, 73, 1126, 812}
        property theBoundz_4 : {353, 122, 1324, 868}
        property theBoundz_5 : {466, 201, 1467, 1129}

        property displayRezolution_Lowest : {0, 0, 1024, 640}
        property displayRezolution_Lower : {0, 0, 1280, 800}
        property displayRezolution_Default : {0, 0, 1440, 900}
        property displayRezolution_Higher : {0, 0, 1680, 1050}
        property displayRezolution_Highest : {0, 0, 1920, 1200}

        tell application "Finder" to set getRez to get bounds of window of desktop

        if displayRezolution_Lowest is equal to getRez then
            centerFinderWindow(theBoundz_1)
        end if
        if displayRezolution_Lower is equal to getRez then
            centerFinderWindow(theBoundz_2)
        end if
        if displayRezolution_Default is equal to getRez then
            centerFinderWindow(theBoundz_3)
        end if
        if displayRezolution_Higher is equal to getRez then
            centerFinderWindow(theBoundz_4)
        end if
        if displayRezolution_Highest is equal to getRez then
            centerFinderWindow(theBoundz_5)
        end if

        on centerFinderWindow(theBoundz)
            tell application "Finder"
                try
                    tell its Finder windows
                        set its current view to column view
                        set its bounds to theBoundz
                        delay 0.1
                        set its sidebar width to sidebarWidth
                        delay 0.1
                        set its toolbar visible to true
                        delay 0.1
                    end tell
                    tell its Finder windows
                        set its sidebar width to sidebarWidth
                    end tell
                end try
            end tell
        end centerFinderWindow
    end script
end script

script displayRezolutionHighest
    property savedBoundz6 : {{1277, 22, 1920, 602}, {0, 22, 632, 602}, {1277, 603, 1920, 1200}, ¬
        {0, 603, 632, 1200}, {633, 603, 1276, 1200}, {633, 22, 1276, 602}}
    property savedBoundz5 : {{961, 22, 1920, 602}, {0, 22, 960, 602}, {1277, 603, 1920, 1200}, ¬
        {0, 603, 632, 1200}, {633, 603, 1276, 1200}}
    property savedBoundz4 : {{961, 22, 1920, 602}, {0, 22, 960, 602}, {961, 603, 1920, 1200}, ¬
        {0, 603, 960, 1200}}
    property savedBoundz3 : {{1277, 22, 1920, 1200}, {0, 22, 632, 1200}, {633, 22, 1276, 1200}}
    property savedBoundz2 : {{938, 22, 1920, 1200}, {0, 22, 937, 1200}}

    tell application "Finder"
        if (count of every window) = 6 then
            set theBoundz to savedBoundz6
            repeat with theWindow from 1 to count of theBoundz
                set theItem to item theWindow of theBoundz
                try
                    set the bounds of Finder window theWindow to theItem
                end try
                delay 0.1
            end repeat
        else if (count of every window) = 5 then
            set theBoundz to savedBoundz5
            repeat with theWindow from 1 to count of theBoundz
                set theItem to item theWindow of theBoundz
                try
                    set the bounds of Finder window theWindow to theItem
                end try
                delay 0.1
            end repeat
        else if (count of every window) = 4 then
            set theBoundz to savedBoundz4
            repeat with theWindow from 1 to count of theBoundz
                set theItem to item theWindow of theBoundz
                try
                    set the bounds of Finder window theWindow to theItem
                end try
                delay 0.1
            end repeat
        else if (count of every window) = 3 then
            set theBoundz to savedBoundz3
            repeat with theWindow from 1 to count of theBoundz
                set theItem to item theWindow of theBoundz
                try
                    set the bounds of Finder window theWindow to theItem
                end try
                delay 0.1
            end repeat
        else if (count of every window) = 2 then
            set theBoundz to savedBoundz2
            repeat with theWindow from 1 to count of theBoundz
                set theItem to item theWindow of theBoundz
                try
                    set the bounds of Finder window theWindow to theItem
                end try
                delay 0.1
            end repeat
        else if (count of every window) = 1 then
            run script centerWindow
        else if (count of every window) = 0 then
            return
        else if (count of every window) is greater than 6 then
            return
        end if
    end tell

    script centerWindow
        property sidebarWidth : 259
        property theBoundz : missing value
        property theBoundz_1 : {163, 76, 876, 547}
        property theBoundz_2 : {260, 119, 1060, 652}
        property theBoundz_3 : {305, 73, 1126, 812}
        property theBoundz_4 : {353, 122, 1324, 868}
        property theBoundz_5 : {466, 201, 1467, 1129}

        property displayRezolution_Lowest : {0, 0, 1024, 640}
        property displayRezolution_Lower : {0, 0, 1280, 800}
        property displayRezolution_Default : {0, 0, 1440, 900}
        property displayRezolution_Higher : {0, 0, 1680, 1050}
        property displayRezolution_Highest : {0, 0, 1920, 1200}

        tell application "Finder" to set getRez to get bounds of window of desktop

        if displayRezolution_Lowest is equal to getRez then
            centerFinderWindow(theBoundz_1)
        end if
        if displayRezolution_Lower is equal to getRez then
            centerFinderWindow(theBoundz_2)
        end if
        if displayRezolution_Default is equal to getRez then
            centerFinderWindow(theBoundz_3)
        end if
        if displayRezolution_Higher is equal to getRez then
            centerFinderWindow(theBoundz_4)
        end if
        if displayRezolution_Highest is equal to getRez then
            centerFinderWindow(theBoundz_5)
        end if

        on centerFinderWindow(theBoundz)
            tell application "Finder"
                try
                    tell its Finder windows
                        set its current view to column view
                        set its bounds to theBoundz
                        delay 0.1
                        set its sidebar width to sidebarWidth
                        delay 0.1
                        set its toolbar visible to true
                        delay 0.1
                    end tell
                    tell its Finder windows
                        set its sidebar width to sidebarWidth
                    end tell
                end try
            end tell
        end centerFinderWindow
    end script
end script

Assicurati di impostare i valori delle proprietà sulle risoluzioni di visualizzazione disponibili del monitor, nella parte superiore dello script

Per impostare la dimensione e le posizioni (limiti) delle finestre del Finder, posiziona manualmente e ridimensiona (con il tuo mouse) ciascuna finestra del Finder. Quindi in Script Editor, esegui questo codice seguente, quindi copia semplicemente le coordinate del risultato e incollale nuovamente nello script principale

tell application "Finder" to set getRezolution to get bounds of window of desktop
tell application "Finder" to set theCount to count of every Finder window
tell application "Finder" to set theBoundz to bounds of every Finder window

EccounesempiocheesegueilservizioAutomator(chepuòessererichiamatodaunascorciatoiadatastiera)inFinder,cheiniziaconseifinestre,quindifinoinfondoaunafinestra...

    
risposta data 14.07.2018 - 08:54
fonte
0

Per le persone che si stanno chiedendo cosa Apple ha aggiunto nel frattempo: puoi sorta di ottenere un risultato simile con la funzione Finestra divisa : link

Tranne che:

  1. È limitato a due finestre
  2. Le finestre provengono da due diverse app
  3. Le app vengono messe in modalità schermo intero

Comunque, Apple sta cercando di fare qualcosa al riguardo, anche se stanno reinventando la ruota invece di guardare a ciò che altri altri fornitori di software desktop stanno facendo in questo senso.

    
risposta data 06.12.2018 - 11:19
fonte

Leggi altre domande sui tag