I want to write a script in AppleScript that resizes the currently focused window.
I wrote this in AppleScript (by looking at examples online):
set menubarHeight to 0
set screenWidth to 1440
set screenHeight to 849
tell application "System Events"
set frontApp to name of first application process whose frontmost is true
end tell
if (frontApp is equal to "Finder") then
set menubarHeight to 44
end if
tell application frontApp
set bounds of window 1 to {0, menubarHeight, screenWidth, screenHeight}
end tell
It works on some windows, but not all applications (like Opera or Mozila).
So I read up that I need to use the accessibility API to do this.
However, I can not figure out how to use the API in AppleScript.
The thing is I am not a computer person persay, but I would like this script to make my computing experiences easier with OS X.
I am hearing I have to write this program with XCode but I do not know how to do that and do not have time to learn unless I really have to.
Can anyone help me out please???
What I was trying to do is have a few scripts that did these things:
-resize a window to take up the whole screen (less the menubar and dock)
-resize a window to take up the left half of the screen
-resize a window to take up the right half of the screen
-resize a window to take up the top half of the screen
-resize a window to take up the bottom half of the screen
-resize a window to take up the top left quadrent of the screen
-resize a window to take up the top right quadrent of the screen
-resize a window to take up the bottom left quadrent of the screen
-resize a window to take up the bottom right quadrent of teh screen
Any help would be greatly appreciated. I have been trying to figure this out for days no.
Thank You
Model: MacBook Pro
Browser: Firefox 1.5.0.6
Operating System: Mac OS X (10.4)