20 May, 2010

AppleScript: Maximise Safari

The maximise button in OS X doesn't behave like the one in Windows. You can get a program to make it behave like that.

I don't have such a program, and I like my Safari windows to be fullscreen, so I use this AppleScript:

tell application "Safari"
set bounds of window 1 to [0, 0, 1440, 900]
end tell

You can test it right now by selecting the script, from "tell" to "tell", including both tells, clicking on the Safari menu at the top left (next to File) > Services > Run as AppleScript. You might have to change the numbers if you have a higher resolution monitor (lucky you). If you want to make it more permanent, open AppleScript Editor (the fastest way is to open Spotlight (⌘+Space) and start typing "apple..." and select the application), copy and paste then save it as a script. If you save it in your Scripts folder (HD>Library>Scripts) and enable the AppleScript menu, you can run it in 2 clicks.

No comments:

Post a Comment