Center window in the screen

How to center a window in the screen ?

i tried : tell current window to center. But nothing happen !

If you have an NSWindowController you should use

NSWindowController's |window|()'s center()

Also the syntax you’ve tried for is Applescript-Studio and not ApplescriptObjC.

So i put a NSWindowController in my IB Should i make a connection ?)

and when i integrate “NSWindowController’s |window|()'s center()” in my script, it says
“expected expression but found command name”.

What’s wrong ?

I don’t think you need a window controller. If you have a window called myWindow, then just do:

myWindow’s |center|()