Skip to content

Center a Window

Found a useful posting at Coding AppleScript on centering windows in AppleScript Studio.

 
tell every window to center

I used this tip to figure out how to automatically center my splash window when the application first opens:

 
on will open theObject
	if the name of theObject is "homeWindow" then
		tell theObject to center
	end if
end will open

This gets called before the window displays.

New Applescript Blog

Is it just me, or are there very few weblogs out there for people trying to learn applescript? There are none, that I can find, which are dedicated to learning Applescript Studio.

I am only an amateur when it comes to programming and I am new to applescript. However, when I’m not doing my historical research for my PhD dissertation, I sometimes get in the mood to tinker with coding as a form of stress release and recently I have been trying to write an application using Applescript Studio, which is now simply a part of XCode (I’m using XCode 3.1 on Leopard).

I will use this weblog to organize some of the useful advice and sample code that I have come across while trying to learn the applescript language but especially how it is applied to developing applications in AppleScript Studio/XCode.

There are some wonderful resources out there for learning applescript and applescript studio. Below are some that I have found useful.

Apple Documentation

Chief among them is Apple’s own excellent documentation:

Applescript Studio Programming Guide
Applescript Studio Terminology Reference

Samples

The applescript studio samples that can be found on your hard drive if you have the development tools installed are fantastic:

Applescript Studio Sample Applications

There are also really useful samples available at JNSoftware. Click on the various links at the bottom left, and also see his list of miscellaneous project files.

MacScripter

The best one stop location on the internet for information about applescript and applescript studio are the forums of MacScripter.

AppleScript OS X Forum
ApplesScript Studio Forum
MacScripter Code Exchange

Please search the Apple documentation and their forums before posting them a message. They understandably get annoyed when newbies waste their time with simple questions that are answered well in the help files, the sample applications, and in countless previous postings on the forums.

If you find the forums useful, then do them a favor and support MacScripter with a donation. It is a truly amazing resource.

AppleScript Studio/XCode Tutorials

Cocoa Dev Central Applescript Studio Tutorial
Technological Supernova Applescript Studio Tutorial
Referring to Objects in Applescript Studio
MacTech AppleScript Studio: Implementing Preferences System
Create a Browser in AppleScript Studio

Books

I have only read one book on AppleScript but I have found it to be excellent. Consider reading:

AppleScript: The Definitive Guide, 2nd Edition
by Matt Neuburg (2006)

In the posts to come on this weblog, I will include little snippets of code I found through MacScripter, documentation, sample code, other websites, or more unlikely, that I came up with myself.