Ultimate Find / Modular Scripting pt. 2
Subtitles of the Movie
So let's go take a look at something. We'll save this and we'll go back to our Open script to remind you that we have this option for If Get Privilege Set Name equals Full Access, install this menu set, the standard FileMaker menus; otherwise, install the user menu set. So we can use that. In fact, I want to do some little change here. We want to put this in here, the Show-Hide Status area, and lock it, because people really shouldn't get access to that Status toolbar at all. We don't want to get them in there. We should have a nice interface that doesn't require them to go there and then we can use all that extra real estate for whatever we want to do. Then I'll duplicate this and on the full access I'll say hide it, but what I want to do is, if I want to get in there, I don't want it locked, so I can get in there if I want. Remember about the Show /Hide Status area, that once you set it on, it's session-based. So if I hide it and lock it, it's going to be hidden and locked for that entire session until I close the file. So I only have to do it once, but with other script steps, such as Allow User Abort, you have to turn it on and off for every time you run a script. It goes back to the default automatically. So what we're going to do is, to make this even easier, so we don't forget, I'm going to copy the If Get privilege Set Name equals Full Access, the Else and the Endif, and we have to do this with the keyboard command from here. We'll close that, save it, come back to our Allow User Abort and edit it, and we'll click down in here. Make sure you're not clicked up here or you can't paste. Well, you could paste, but you'll paste text here. You need to paste these script steps here and we'll move this in here. We'll come in and duplicate this and then we'll turn this to on when it's full access and off when it's anybody else. So now you don't have to remember to turn them on and off. It's always on for you, meaning you can cancel a script, and always off for everybody else. I can't tell you how many times I've forgotten to turn that script back to off or on and then you're in trouble. This just does it automatically, no thinking at all, so this makes it very easy, so all you have to do now, at this point, is go through all your scripts and add Allow User Abort to every one because every single script should have this Allow User Abort step right at the beginning. All of them should prevent you from canceling a script. So let's try it out. We'll switch back to Customers Form, hit that button, and you notice that right now, because we're logged on with our admin account, it is allowing us to abort this script if we want, so we'll hit Cancel here. What we're going to do is come over here and close the file, open it back up, and this time we're going to type in User 1, 1, 2, 3, 4, and we'll see the difference here. So we'll run this. Notice that you also have your Status toolbar is locked. You can't get into it. It's dimmed out. We'll click that and now, while we can't see that area in there, we can try to do the keyboard command and I can tell you I'm doing Apple period or Command period here and I'm not canceling it. So that Cancel button, if we could see the Status toolbar, is actually gone. It's not there, but they can use our Cancel button if they want, so everything works great. So, I highly recommend modular scripting because it can really help you reuse your code and make things much easier for you. This is probably the simplest implementation of modular scripting. We'll get into more complex scenarios, but you can see how just in this simple scenario, it makes life really easy for you.
Tutorial Information
| Course: | FileMaker Pro 10: Advanced |
| Author: | John Mark Osborne |
| SKU: | 33927 |
| ISBN: | 1-935320-20-3 |
| Release Date: | 2009-01-05 |
| Duration: | 12 hrs / 150 lessons |
| Work Files: |
Yes |
| Captions: | Available on CD and Online University |
| Compatibility: |
Vista/XP/2000, OS X, Linux QuickTime 7, Flash 8 |
VTC Sign up & Benefits
- Unlimited Access
- 81,350 Video Tutorials (20,800 free)
- Video Available as Flash or QuickTime
- Over 782 Courses
- $30 for One Month Access
- Multi-User Discounts Available
United States 