Programming the Mac is my hobby. I used to program in Pascal a long time ago, but with the switch to Objective C and the coming of AppleScript Studio I adopt new habits. I like the readability of AppleScript, but programming in AppleScript is not as simple as it seems to be. Here are some snippets I developed for training. To download the snippet click on the terminal icon, on the left.
P.S. Tools: XCode, Sites:  AppleScript, AppleScript Studio, Apple Developer. 

iWeb Sites Manager  (Updated May 26, 2006)
Since Apple released iWeb 1.1, this applet is no more necessary. This AppleScript Studio application allows to manipulate more than one site with the Apple application iWeb 1.0. Please read carefully the “Read me” before using it. 

Synchronize folder  (March 23, 2006)
This AppleScript Studio application synchronizes the content of a “destination folder” with the content of a “source folder”. It runs the shell command "rsync", given a default behavior. The source and destination folder are defined by drag'n drop. And once completed, the command can be saved as an AppleScript script.

Default Spell  (March 2006)
This snippet changes the default spell language from english to french and vice-versa, by encapsulating the "defaults read" and "defaults write" command into a small Applescript. Clicking the appropriate button changes the default spell as well as the flag picture of the interface. It is easy to change or add default languages.

Sample Expand/collapse item  (March 2004)
This is an AppleScript Studio snippet, it shows how to make items in an Outline View (without children) and how to decide if they have a disclosure triangle or not (independantly of having children). It shows how to expand or collapse data items programatically by using the Objective C method «expandItem:» or «collapseItem:». 

Date Utility (March 2004)
This is a little AppleScript function, it returns the date formated with chosen date and time delimiters.

Animate images (February 2004)
This AppleScript Studio snippet make an animation with a set of pictures contained in a folder. You drag a folder on the main window and the snippet looks inside for the pictures an play them with a delay fixed by the user.

Save location (February 2004)
This AppleScript Studio Snippet stores the reference of a selected folder, as an alias file pointing to this folder. This alias is located in the associated “Save location” application folder of the Apple "Application Folder".

Animate Wheel (February 2004)
This AppleScript Studio snippet displays a list of images of a wheel giving the appearance of an animated wheel. The window contains an image view for the wheel, two buttons "Run" and "Stop", a disclosure button connected to a drawer and a speed slider.

Save text (February 2004)
This AppleScript Studio snippet shows how to save the content of text field and switch buttons, and how to revert the content of this interface from the saved data. The main window contains a text field inside a scroll view, switch buttons for the text color and two buttons "Save" and "Revert to Saved ".

Store files (February 2004)
This little AppleScript Studio application shows how to use a drag and drop handlers implemented in ASS. The user drags a selection of files on the box image of the window, the set of files is then displayed in the close text field and a button for storing the files is enabled. When the user click on the "store" buton he can choose a folder and save its files inside.http://developer.apple.com/tools/macosxtools.htmlhttp://www.apple.com/applescript/http://www.apple.com/applescript/studio/index.htmlhttp://developer.apple.com/Programming_files/iWeb%20Sites%20Manager-1.ziphttp://www.apple.com/support/iwebProgramming_files/Synchronize%20Folders%20Snippet-1.zipProgramming_files/Default%20Spell%20Snippet.zipProgramming_files/Sample%20expand%20item.zipProgramming_files/DateUtility.zipProgramming_files/Animation%20Snippet.zipProgramming_files/SaveLocation.zipProgramming_files/Animate%20Whell%20Snippet.zipProgramming_files/Save%20Text%20Snippet.zipProgramming_files/Store%20files.zipshapeimage_1_link_0shapeimage_1_link_1shapeimage_1_link_2shapeimage_1_link_3shapeimage_1_link_5
Programming 
       on fact(n)
          if n=0 then
           return 1
         else
           return n*fact(n-1)
         end if
       end fact