Switching to iPhone layout automatically
Is there a way for a Filemaker server database to know it's being opened using FMGO on an iPhone and switch to the appropriate layout?
The best way is to run a script as the file starts up and within that IF script step to check the application version.
get ( ApplicationVersion ) return "Go 1.0.x" on the iPhone and iPod Touch. On the iPad, this function returns "Go_iPad 1.0.x".
Then, based on the result go the required layout. You might consider also using a pattern count of the result to future proof this solution
I was thinking of using a conditionnal based on the Get functions just a few minutes after my OP. Might i though ask how I should formulate the syntax "contains" so I can simply ask for the result of the Get(ApplicationVersion) contains "Go". I imagine I shuld use the "*" symbol to use a wildcard, but I am more versed in Applescript than FMscripting.
Thanks in advance for your help.
I worked this out in the meantime:
PatternCount ( Get ( ApplicationVersion ) ;"Go") which checks if the word "Go" exists in the app version. Tested on both dektop and iPhone. I'll let you do the iPad testing, MODUK.
I'm attempting to do the same thing but I am getting the application version of the host server, not the client application on the ipad, iphone, or Mac that I'm using to test.
Chris, the snippet of code I posted returns a true or a false.
What version(s) are you working with ? I am working with Server/Clients in 11 and the latest FMGO.
I frankly don't know where it's going wrong for you.
@Chris - I have just tried this on a test DB and it works just fine on all 3 devices: desktop, iPad, iPod/touch
Here is the script (could probably be better, but it works :)
If[PatternCount(Get( ApplicationVersion );"iPad")]
Go to layout ["pad"]
Else if[PatternCount(Get( ApplicationVersion);"Go")]
Go to layout ["touch"]
Go to layout ["desk"]
Once you create and save the script, then go to File > FIle Options > Perform Script > Specify... the script you just created :)
You can also add a check for window orientation and window size on the iPhone/iTouch in the event that is important. Use Get(windowContentHeight) and width. I wonder if you can determine if the phone is being held upside down?
Retrieving data ...