Software Venture Consulting

FileMaker Pro downloads & Resources
FileMaker Custom Functions
FileMaker Web Viewer Examples
FileMaker Pro & Lasso Consulting
FileMaker Books
FileMaker Articles
FileMaker Error Reference

Free Web Tools
Free FileMaker Tools

Personal Pages

Shopping Cart
Shopping Cart


Free Newsletter


Privacy Policy

FileMaker is a registered trademark of FileMaker, Inc. in the U.S. and other countries.


 FileMaker Pro Custom Functions

List  |  Show Random  |  Upload  |  Add This to Your Site

CenterWindow in Window vert horiz (demension)

Rate this function:  

  Average rating: 4.6  (32 votes)
  Discuss this Custom Function

Todd Dignan, Dignan Consulting Inc

Center Window in Window

Sample Input:
CenterWindow in Window vert horiz (vert) or CenterWindow in Window vert horiz (horiz)
Sample Output:
Center the window vertically basis on the info the custom function WindowInfo gathered. Also when the horiz pram is used the window widow will center horizontally.

 Then copy & paste into FileMaker Advanced's Edit Custom Function window.


This should be used with the "WindowInfo" custom function. (which gathers a windows, height, width, top and left px in global vars.) Call "WindowInfo" custom function first in a script before using this custom function. You will want to use "CenterWindow in Window vert horiz" custom function in a script step GTRR, Move/Resize Window or New Window. In these script steps you will want to place the custom function in the field "Distance from top" CenterWindow in Window vert horiz (vert) and the field "Distance from Left" CenterWindow in Window vert horiz (horiz). This will center the current window in the window info gathered by the custom function "WindowInfo". I hope this makes sense.

Note: these functions are not guaranteed or supported by Please contact the individual developer with any questions or problems.

This is my Custom Function and I want to edit it


I like it, but it doesn't work for me.

my script has:
SetVariable [ $windowInfo; Value:WindowInfo_CF]
NewWindow [Height: 450; Width:630; Top: CenterWindow_CF("vert"); Left: CenterWindow_CF("horiz"); Style: Dialog]

It appears that left and top are set to 0.

Andrew, Austin
October 24, 2012 2:45pm

Hi Andrew,

I think you posted this comment in the wrong custom function. Is custom function is call "CenterWindow in Window vert horiz" not CenterWindow_CF.

Stephen Dolenski do have a custom function name "cf_CenterWindowLeft" and cf_CenterWindowTop. Anyway, if you did want to use this CF you would need to use in conjunction with this CF the CF name "WindowInfo" found at

I hop this helps.

Todd Dignan

Todd Dignan, Los Osos, CA
October 25, 2012 10:19am

I used this function after WindowInfo. (I can see the $$ variables). I used it in Window Resize but it doesn't 'move' the window to a centered location. Huh?

ron, idaho
October 29, 2012 10:45pm

Hi Ron,

It was designed to center a window within a window. The WindowInfo function get the info of the window you want to center the a new or existing window in. Can you send the script(s) that are calling the functions.

Todd Dignan, Los Osos, CA
October 29, 2012 11:49pm

Make a comment about this Custom Function (please try to keep it brief & to the point). Anyone can post:

Your Name:
characters left. If you paste in more than 1500 characters, it will be truncated. Discuss the function - advertisements and other useless posts will be deleted.
Answer 5 + 9 =
Search for Custom Functions:

Custom Functions Widget
Download the Custom Function Dashboard Widget for OS X
Keep all the latest Custom Functions right at your fingertips!

Newest Custom Functions:

1. HexUUIDToNum_cf (_uuid)
  (Sat, Jun 16, 1:55pm)
2. httpResponseCode ( responseHeaders )
  (Tue, Jun 12, 10:40pm)
3. FindDuplicateCharacters ( string )
  (Fri, Jun 08, 5:01pm)
4. FieldRepetitionLast ( field ; maxRepetition )
  (Wed, Jun 06, 6:05pm)
5. CountModifiedRecords ( NameTimestampField ; StartTimestamp ; EndTimestamp )
  (Mon, May 28, 8:23am)
6. JSONArrayLength ( JSONArrayStr )
  (Fri, May 25, 7:46am)
7. interpolation (y1; y2; y3; x1; x2; x3; x1y1; x2y1; x1y2; x2y2; rnd)
  (Sat, May 19, 3:55am)
8. @JSONFormatElements ( json )
  (Tue, May 15, 3:31am)

RSS Feed of Custom Functions