For example, here's a button script that plays boing when clicked on:
on mouseUp
play "boing"
end mouseUp
By default, sounds are played as a quarter note at middle C, but they can be followed by notes (c, d, e, f, g, a, b) and times for each note (w=whole, h=half, q=quarter, e=eighth, s=sixteenth, t=thirty-second; period=dotted). Notes are separated by spaces.
For example: play boing gs gs de ge cw.
This line plays boing in two sixteenth-note Gs, an eighth-note D, an eighth G, and a dotted whole C.