開いているすべてのウィンドウのサイズを変更する AppleScript スクリプトを作成しようとしています。すべてのウィンドウに到達していることを確認するために、スクリプトにアプリケーションの名前と、そのアプリケーションで開いているウィンドウの数を表示させています。
興味深いことに、開いているすべてのアプリケーションの名前が聞こえますが、スクリプトでは、すべてのアプリケーションで開いているウィンドウが 0 であると表示されます。この問題を解決するにはどうすればよいですか?
これが私のコードです:
tell application "System Events"
repeat with theProcess in (every process)
if background only of theProcess is false then
if name of theProcess is not "Finder" then
if name of theProcess is "Google Chrome" then
say "Chrome woo hoo"
say (count windows as string)
else
say name of theProcess as string
say (count windows as string)
tell theProcess
repeat with theWindow in windows
say "found a window of"
say (name of theProcess) as string
tell theWindow
click button 2
end tell
end repeat
end tell
end if
end if
end if
end repeat
end tell
私はMac OS X 10.7.5を使用しており、automator 2.2.4を使用してこのapplescriptを作成/実行しています