Problem opening window when clicking on dock icon

G’day

I’ve built two applescript studio apps that have the same minor problem.

If I close their single window, then click the dock icon without clicking anywhere else first, a new window doesn’t open (unlike Apples apps).

Click somewhere else, then on the dock icon, and hey presto, a new window.

I’ve tried all sorts of calls, but no signal seems to be sent to the app or its menu while it’s still obviously active, and staying frontmost.

Can anyone tell me what procedure to use to fix this small hassle please?

Regards

Santa

Model: intel iMac
Browser: Safari 525.18
Operating System: Mac OS X (10.5)

I’ve found my own answer, it’s use the call ‘on open untitled’ from the Application.