Showing posts with label AppleScript. Show all posts
Showing posts with label AppleScript. Show all posts

24 May, 2010

AppleScript: Open 2 Finder windows

tell application "Finder"
open home
set toolbar visible of first Finder window to true
open startup disk
set toolbar visible of second Finder window to true
--set statusbar visible of second Finder window to true
set current view of every Finder window to list view
set bounds of first Finder window to [0, 44, 720, 880]
set bounds of second Finder window to [721, 44, 1440, 880]
end tell

It's hard to copy files between 2 locations in OS X. I use this script to open 2 Finder windows side by side. The line starting with -- is made into a comment, so it has no effect.

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.