|
|||||||
|
|
|
![]() |
|
|
Strumenti |
|
|
#1 |
|
Senior Member
Iscritto dal: Jan 2010
Messaggi: 37097
|
Modificare Apple script
Mi servirebbe modificare uno script Apple in modo da ridimensionare sidebar e finestre Finder, ma senza centrarle nello schermo. Non sono molto esperto in materia
Lo script in questione è questo: Codice:
(*
This Apple script will resize any program window to an exact size and the window is then moved to the center of your screen.
Specify the program name, height and width below and run the script.
Written by Amit Agarwal on December 10, 2013
*)
set theApp to "Finder"
set appHeight to 412
set appWidth to 678
tell application "Finder"
set screenResolution to bounds of window of desktop
end tell
set screenWidth to item 3 of screenResolution
set screenHeight to item 4 of screenResolution
tell application theApp
activate
reopen
set yAxis to (screenHeight - appHeight) / 2 as integer
set xAxis to (screenWidth - appWidth) / 2 as integer
set the bounds of the first window to {xAxis, yAxis, appWidth + xAxis, appHeight + yAxis}
tell application "Finder" to set the sidebar width of every Finder window to 142
end tell
__________________
Analemma - Slowdive - Facebook Motto Microsoft: "If it's broken, and I'm the one who broke it, don't fix it!" Ultima modifica di Eress : 03-11-2015 alle 16:42. |
|
|
|
|
|
#2 |
|
Senior Member
Iscritto dal: Jan 2011
Messaggi: 9808
|
Ciao
Esattamente, dove vorresti che venisse messa? Per esempio così Codice:
set theApp to "Finder"
set appHeight to 412
set appWidth to 678
tell application theApp
activate
reopen
set yAxis to 100 as integer
set xAxis to 100 as integer
set the bounds of the first window to {xAxis, yAxis, appWidth + xAxis, appHeight + yAxis}
tell application "Finder" to set the sidebar width of every Finder window to 142
end tell
Ultima modifica di superlex : 04-11-2015 alle 02:15. |
|
|
|
|
|
#3 |
|
Senior Member
Iscritto dal: Jan 2010
Messaggi: 37097
|
Allora vedi che avevo ragione, sei un esperto di OS X
Grazie della dritta, il tuo script funziona, ma come temevo non è possibile eliminare la posizione. Il fatto è che poi aprendo due o tre cartelle in sequenza e utilizzando lo script finiscono per sovrapporsi in modo innaturale e scomodo, rispetto al comportamento normale, dove sono leggermente sfalsate e quindi visibili/cliccabili. Del resto il Finder a differenza della sidebar inserita in esso, è un elemento fluttuante e quindi immagino sia obbligatorio inserire la posizione nello script. Forse servirebbe aggiungere qualcosa allo script per l'apertura di eventuali altre cartelle, se si può fare. |
|
|
|
|
|
#4 |
|
Senior Member
Iscritto dal: Jan 2011
Messaggi: 9808
|
Codice:
set theApp to "Finder"
set appHeight to 412
set appWidth to 678
tell application theApp
activate
reopen
tell application "Finder" to set the sidebar width of every Finder window to 142
end tell
tell application "System Events"
tell process theApp
set size of window 1 to {appWidth, appHeight}
end tell
end tell
Devi però andare in Preferenze di Sistema -> Sicurezza e Privacy -> Accessibilità -> Privacy e spuntare Script Editor.app |
|
|
|
|
|
#6 |
|
Senior Member
Iscritto dal: Jan 2011
Messaggi: 9808
|
Ahahahah
Ho trovato tutto su Internet |
|
|
|
|
|
#7 |
|
Senior Member
Iscritto dal: Jan 2010
Messaggi: 37097
|
Beh allora sei un asso nella ricerca, io non l'avevo trovato
Grazie e ciao. PS: e magari passami il link |
|
|
|
|
|
#8 | |
|
Senior Member
Iscritto dal: Jan 2011
Messaggi: 9808
|
Quote:
Figurati
|
|
|
|
|
|
| Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 15:50.



















