Set your application to receive AppleScript events. Then, send the proper Applescript event to your app, which will call a Cocoa IBAction which does whatever you want it to do.
At least, that's how I think I'd do it.
[edit]
I say that's how I think I'd do it because I've never worked with AppleScript or ASS. I know how to do it in Cocoa / Obj-C though.