1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ウィンドウの大きさを制御する

1
Last updated at Posted at 2012-11-04

bounds of window idx of application "APPLICATION NAME"の値を参照することで、アプリケーションの持つウィンドウのうち、前からidx番目の大きさと位置(rectangle)を取得する事ができ、また上書きすることでウィンドウのサイズを制御することができる。idxを指定しない場合は全てのウィンドウのサイズのリストが返ってくるので、纏めて変更したい場合はこちらを使うと便利かもしれない。

以下に例として、前からidx番目にあるGoogle Chromeの幅をscale倍するsetScale関数を示す(ここでは最前面のウィンドウ幅を3倍に引き伸ばしている)。

on getCurrentSize(idx)	bounds of the window idx of application "Google Chrome"end getCurrentSizeon setScale(idx, scale)	set curSize to getCurrentSize(idx)	set (item 3 of curSize) to (item 3 of curSize) * scale as integer	set bounds of window idx of application "Google Chrome" to curSizeend setScalesetScale(1, 3)
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?