Join Cris Ippolite for an in-depth discussion in this video Exploring the OnGestureTap script trigger, part of FileMaker 13 New Features.
Filemaker Pro supports over 20 predefined script triggers that can be used on layouts, fields, buttons, portals, tabs or even a web viewer. Script triggers in Filemaker Pro allow you to automatically run scripts based on user actions like clicking a button, entering a field. or even inputting data. The use of script triggers can be useful in many environments for improving data, entry efficiency, management, and even security. FileMaker 13 has two new script triggers that are useful for solutions that are deployed in FileMaker Go.
One of these new script triggers is called OnGestureTap. The OnGestureTap script trigger executes a script when the tap gesture is received on the layout in FileMaker Go. Gestures that activate this trigger in FileMaker Go are, a single tap with one, two, or three fingers. Or a double tap with a single finger. OnGestureTap does not differentiate between the different types of taps listed above. But if you'd like to get information about the gesture that caused the OnGestureTap trigger to activate, it's recommended that you use the Get Trigger Gesture function.
For example, in our exercise file, if you open up the exercise file, and go to a layout that's called Screen. We look in Layout mode, under this button right here which brings up the Layout Setup. Over on the Script Trigger tab, you see that I have a script trigger OnGestureTap, activated. And it's got a Show Gesture Tap script assigned. Let's take a look at what's in that script. It's just a custom dialogue that shows me the contents returned from the Get Trigger Gesture info function, which is also new in 13.
So if we switch over to the iPad. And if we take a look at the same screen, by clicking on the button in the upper left hand corner that says Screen, that'll take us to the same layout. And now I can demonstrate this feature for you. So, first let me demonstrate a single finger tap. I'm simply hitting the middle of the screen. And onscreen appears a custom dialog with the text inside of it that is just the contents of the Get Trigger Gesture info, Get function. So if you look closely at the Get Trigger Gesture info function, it returns a list containing the following items.
The first item that you see in the list, the string tap, indicates the script was started by an OnGestureTap trigger. The second value in the list, indicates the number of taps, so in this case, one tap. The third value indicates how many fingers were used to make the tap, and in this case, one finger. And the other two values are the x axis coordinate and the y axis coordinate within the document where the gesture occurred. So, in this case, this is returning back a value that says, on tap, one finger was used to tap once.
So if I hit the cancel button now, and I'm going to try now with two fingers. So now you see I got essentially the same values. Tap, one. That's one tap but in the third value, that's where we're seeing changes here. Two fingers were used to tap once and then the coordinated for those. Let's try three fingers. I click three fingers in the middle of the screen. And I get tap 1 and 3. So the idea here is that the Gesture tab can display an array of values that can indicate how many fingers we use to tap, as well as how many taps. So then you can reference these in a script that is run to tell the script to do certain things based on different taps.
Let's go back to our FileMaker file. And if we navigate over to the Customer Details iPad layout, I want to show you that I set up something to demonstrate this. So first of all, you see these red outlines. Normally I would not be showing red outlines, but for purposes of training I want you to see where these are, because otherwise these are hidden. What these are are 2 different slide controls. I'll show you by double clicking on it. You see this Slide Control Setup occur. We've got 2 different slides here. So the first slide has nothing in it, and that's an important part of this technique.
And the second one has a series of grouped navigation elements, so this is really the NAV bar, showing that we're currently in the context of customers. So the trick here is that we have two slides. One is empty and one has a value in it and we're enabling swipe gestures. And by not having anything in the first gesture and then making it transparent, so I'm making the fill transparent except for the solid lines, of course, there's nothing in this first one.
Technically, that slide is actually always being shown, but because it's transparent, we're going to be able to see everything that shows up behind it. So in this case, it's things like this button and this plus button, and so on. I did the same thing down here with another slide control, same technique. In this case, they're much larger. This one covers the entire size of the screen. So what I'm doing is I've got the first slide empty and now the second slide is completely occupied by web viewer. So empty, webviewer, and so on. The other thing that's important about this is that these individual slides, you can see, we can name each individual slide, So the first slide doesn't have a name, the second one says, Second Help. Let's go over here again, first slide no name, second slide called Second.
So the idea behind this technique that I'm about to show you is that we going to allow the user to tap on the screen. And based on the number of fingers that they use, they can either tap to bring up the NAV bar, or tap to bring up this Help system, or this web viewer in this case. All this is driven through some scripts. So, first, if we look at the Layout Setup, over in Script Trigger, here we have the OnGestureTapScript trigger being used. And if we take a closer look at the script that I'm using, when a user is accessing this database on Go, and they tapped the screen, then that's going to run this script.
And what the script is set up to do is to identify what number of taps there are. So what I've done here is I've used a combination of the GetTriggerGesture info function which gives me that array of values. And then a GetValue function, which is not new in 13, but what this does is allow me to take a certain value. So that means a single tap, that's the second value, with three fingers. So if it detects a single tap with three fingers then run a script called go to help which we'll look at in a second Same thing here.
In this case, if a single tap with just two fingers is detected, then run another script called GoToNav. Let's go over here again. Now those scripts, GoToNav, does a GoToObject, where I'm going to the second object in the slide control. That's an important part of this. Even more important though, is this new script step called Set Animation. I turn Animation on, and what that means is on Go I want to call the second slide. In this case it's going to be this group of buttons.
And when I call it, I want the animation effect to happen where it slides in from off-screen. So all of these are triggered by the OnGestureTap. For the purposes simply of showing you where these are in Layout mode, I've left the red lines on the outside. Now in order to actually see this work, what we're going to do is switch back over to the iPad, and I'm going to go back to that screen. And now we see on the iPad that I've got the red areas are still there, those are just there for guides that you can see how this works. But what I'm going to do is, I'm going to tap with two fingers, and the reason I'm doing two and three fingers here is because you do single taps for pretty much everything you're doing on screen, so I didn't want to confuse FileMaker.
So let's see what happens when I simply click anywhere in the screen and do two finger tap. You'll notice that after the two finger tap, on the top part of the screen, my menu slid in. I happen to think that's a really cool effect. The menu slides in because it's actually the second slide. The second slide is named the word Second. So really, what I've done, is I've used the OnGestureTap, to run a script that says hey, if you detect two fingers, then run this script that pulls that second slide in. I think it's got a really neat effect. What's even cooler about it, is because these gestures are supported, the single finger swipe is supported for slide controls, I'm going to use a single finger, and I'm going to slide to the right and then thus dismiss that so I can see the items behind it.
Let' try a three finger tap now. Three finger tap, now it brings the web viewer forward which is pretty cool. So it brings that entire web viewer forward and I can do the same thing with a single swipe across to dismiss it. So, double finger tap brings our menu across, three finger tap brings the web viewer across. And I can dismiss both of them with a single swipe to the right. Now, in FileMaker 13 and FileMaker Go, we have the ability to detect user interactions like finger taps. And in this case we can, detect those finger taps, and run different scripts to provide cool-looking app-like interfaces, much like the ones you've seen in this demonstration, giving us the ability to use FileMaker to create FileMaker Go apps, in an easier fashion than we've ever been able to before.
- An overview of the new FileMaker 13 platform
- Working with Object States
- Defining custom styles
- Creating new themes
- Object visibility
- Applying Active state to portal rows and lists
- Outer and inner shadow and padding
- Working with popovers
- FileMaker Server 13 Admin Console
- Uploading files to FileMaker Server 13
- Performing scripts on the server
- New FileMaker script triggers
- Base64 encoding and decoding
- The new Get functions
- Introducing WebDirect
- The new FileMaker Go 13
- Custom iOS keyboard types
- Barcode scanning