The Original FileMaker Community
Business Templates - Demo Apps - Video Tutorials -Samples - Help - 46000 Member Forum

The Leading Filemaker Developer Tools

Checking Screen Orientation in FileMaker Go – FileMaker Today

Get real time updates directly on you device, subscribe now.

A reader asks: When developing for FileMaker Go, is it possible to write a script that does one thing do if the iPhone or iPad is held vertically and another if it’s held horizontally?  How it could be done? “Yes we can!” (my son has been watching a lot of Bob the Builder). We need the Get ( WindowContentHeight ) and Get ( WindowContentWidth ) functions.

There are several other functions that can be used to get screen and window dimensions, but for some reason only the WindowContent functions actually return different values depending on whether the iOS device is in portrait or landscape orientation.  On my iPad, here’s what these functions return:

Function Portrait Landscape
Get ( ScreenHeight ) 1024 1024
Get ( ScreenWidth ) 768 768
Get ( WindowHeight ) 1024 1024
Get ( WindowWidth ) 748 748
Get ( WindowContentHeight ) 973 717
Get ( WindowContentWidth ) 768 1024

So, if Get ( WindowContentWidth ) > Get ( WindowContentHeight ), your device is in landscape orientation, otherwise it’s in portrait orientation.  Your script should test for this and do the appropriate thing:

If [Get ( WindowContentWidth ) > Get ( WindowContentHeight )]
  # it's in landscape…
  # it's in portrait…
End If

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More