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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Create New...

Important Information

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