Last active
May 24, 2020 02:19
-
-
Save daimon99/1e6a66a8575660053eeda2209caaf84b to your computer and use it in GitHub Desktop.
mac sizeup 的替代品,自动按需调节 app 位置 / Mac sizeup alternative
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on run {input, parameters} | |
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 | |
set theApp to (path to frontmost application as Unicode text) | |
tell application "System Events" to tell (process 1 where it is frontmost) | |
tell window 1 to set {size, position} to {{screenWidth * 0.6 as integer, screenHeight * 0.8 as integer}, {screenWidth * 0.2 as integer, screenHeight * 0.05 as integer}} | |
end tell | |
end run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on run {input, parameters} | |
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 | |
set theApp to (path to frontmost application as Unicode text) | |
tell application "System Events" to tell (process 1 where it is frontmost) | |
tell window 1 to set {size, position} to {{screenWidth * 0.5 as integer, screenHeight * 1 as integer}, {0, 0}} | |
end tell | |
end run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on run {input, parameters} | |
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 | |
set theApp to (path to frontmost application as Unicode text) | |
tell application "System Events" to tell (process 1 where it is frontmost) | |
tell window 1 to set {size, position} to {{screenWidth * 0.5 as integer, screenHeight * 1 as integer}, {screenWidth * 0.5 as integer, 0}} | |
end tell | |
end run |
Author
daimon99
commented
May 7, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment