パソコンとの付き合いは20年以上。最初はWindowsを使っていたが、務めていたソフトウェア開発会社…
AppleScript、ターミナルを使う
更新日:2009年06月06日
Macを使い始めて戸惑うのがウインドウの操作です。せめて、縦方向のサイズだけでもきっちりデスクトップのサイズに合わせてくれれば……というわけで、AppleScriptで作って自動化してしまいましょう。
set bounds of window 1 of application "Safari" to {0,0,800,600}
tell application "Finder" set displayBounds to bounds of window of desktop end tell
set winBounds to bounds of window 1 of application "Safari"
set item 4 of winBounds to (item 4 of displayBounds) - 20
set bounds of window 1of application "Safari" to winBounds
tell application "System Events"
tell process "ComicStudio EX 30"
set topWindow to item 1 of (every window whose focused is true)
set size of topWindow to {800, 600}
end tell
end tell
on reopen
set bounds of window 1 of application "Safari" to {0,0,800,600}
end reopen
property appName:"" on idle tell application "System Events" set pList to name of every process whose frontmost is true set appName to item 1 of pList end tell return 1 end idle
property appName:""
on idle
tell application "System Events"
set pList to name of every process whose frontmost is true
set appName to item 1 of pList
end tell
return 1
end idle
on reopen
set bounds of window 1 of application appName to {0,0,800,600}
end reopen
property appName : ""
on idle
tell application "System Events"
set pList to name of every process whose frontmost is true
set appName to item 1 of pList
end tell
return 1
end idle
on reopen
tell application "Finder"
set displayBounds to bounds of window of desktop
end tell
tell application "System Events"
tell process appName
try
set topWindow to item 1 of (every window whose focused is true)
on error
set topWindow to window 1
end try
set winSize to size of topWindow
set winPos to position of topWindow
set item 2 of winSize to ((item 4 of displayBounds) - (item 2 of winPos) - 20)
set size of topWindow to winSize
end tell
end tell
end reopen
関連キーワード[PR]
人気Mac OSの使い方ランキング
Powered by 価格.com
関連キーワード[PR]