Filemaker Question: how to set a file launching script decided by iphone vs laptop

HIROYUKI TAMURA
HIROYUKI TAMURA used Ask the Experts™
on
I need an advice for filemaker file opening script.
I would like to set a launching script when opening a filemaker file and decide a layout, depends on the device type, like laptop vs smartphone.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
President, Dedication Technologies, Inc.
Commented:
You would use an If/Else If/Script steps and the Get(Device) function which gives a numeric result depending on what is detected.

  • 0 for an unknown device
  • 1 for a Mac
  • 2 for a computer running Windows
  • 3 for iPad
  • 4 for iPhone or iPod touch
  • 5 for Android

For example:

If [ Get(Device) = 3 ]
   Perform script [ "Startup - iPad" ]
Else If [ Get(Device) = 4 ]
   Perform script [ "Startup - iPhone" ]
Else
   Perform script [ "Startup - Laptop" ]
End If

https://fmhelp.filemaker.com/help/18/fmp/en/index.html#page/FMP_Help/get-device.html


If you also want to know whether the file is opening via FileMaker Pro, FileMaker Go, or WebDirect, you can add additional conditions using the Get(ApplicationVersion) to determine exactly what Filemaker app or configuration is being used.

https://fmhelp.filemaker.com/help/18/fmp/en/index.html#page/FMP_Help/get-applicationversion.html


Finally, if you need the exact platform and OS version to finetune what you're doing you can use Get(SystemVersion)

https://fmhelp.filemaker.com/help/18/fmp/en/index.html#page/FMP_Help/get-systemversion.html

Author

Commented:
Thank you, Will Loving!
Will LovingPresident, Dedication Technologies, Inc.

Commented:
One other note: you don't actually need separate startup scripts for each device or platform. Instead of what I put above you could also just put the steps in that you want it to do when that platform is detected.

If [ Get(Device) = 3 ]
   Go to Layout [ "Home - iPad" ]
Else If [ Get(Device) = 4 ]
   Go to Layout [ "Home - iPhone" ]
Else
   Go to Layout [ "Home" ]
End If

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial