text 自动调整Mac App窗口的大小

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了text 自动调整Mac App窗口的大小相关的知识,希望对你有一定的参考价值。

(* This AppleScript will resize the current application window to the height specified below and center it in the screen. Compiled with code from Natanial Wools and Amit Agarwal *)

set the_application to (path to frontmost application as Unicode text)
set appHeight to 1440
set appWidth to 900

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 the_application
  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}
end tell

以上是关于text 自动调整Mac App窗口的大小的主要内容,如果未能解决你的问题,请参考以下文章

Mac Catalyst 调整屏幕截图的窗口大小

如何在 Mac Catalyst 中检测窗口大小调整?

Mac ps如何调整文字大小与位置

Mac 窗口不会让我调整到更小,可能是限制?

qt 窗口控件自动调整大小

C#,实现窗口大小改变时窗口内的控件自动调整位置和大小时,groupbox内的控件为啥不自动调整