Jump to content
Sign in to follow this  

center window script

Recommended Posts

I have an old script for centering a window, but now on an intel mac it is not working, any suggestions?

Distance from Top

(Get ( ScreenHeight ) - Abs(Get(SystemPlatform) + 1) * 150 - Get ( WindowContentHeight )-35) / 2

Distance from Left

(Get ( ScreenWidth ) - (Get ( WindowContentWidth )+14)) / 2

//14 add to width for mac scroll bar

Share this post

Link to post
Share on other sites

I think the problem is Abs(Get(SystemPlatform) + 1)

That's like saying

Abs( 1 + 1 ) // =2 on Intel Mac

Abs( -1 + 1 ) // =0 on PPC Mac

Abs( -2 + 1 ) // =1 on Win2000 or XP

should be

Abs(Get(SystemPlatform)) + 1

Seems like it wouldn't have worked right before either!

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  


Important Information

By using this site, you agree to our Terms of Use.