On Apr 19, 2012, at 06:37, Francis Nugent Dixon wrote:
I am looking for an AppleScript that can redefine all window parameters (for any existing windows), assuming that my window names give specific information concerning their values.
Am I asking too much, or is Applescript as powerful as they say ........ :)
My attempts into Applescript have been quite limited, which explains why I would not even know where to start solving this problem.
The problem is that not all applications are scriptable. You can invoke System Events for those, and probably using Shane Stanley's ASObjC Runner you can do calls to the underlying Cocoa - but the level of complexity rises.
Here are a few examples of what you can do with System Events and directly with a scriptable app (Mail).
---------------------------------------------------
tell application "System Events"
tell item 1 of (processes whose frontmost is true)
set frontAppWinProp to properties of its windows
end tell
end tell
---------------------------------------------------
tell application "System Events"
tell process "Mail"
set frontmost to true
tell window 1
set position to {528, 22}
set size to {905, 1174}
end tell
end tell
end tell
---------------------------------------------------
tell application "Mail"
set bounds of front window to {528, 22, 1433, 1196}
end tell
---------------------------------------------------