Join Cris Ippolite for an in-depth discussion in this video Understanding the Scriptmaker dialog window, part of FileMaker Pro 13 Essential Training.
Couple of things you're going to have to get use to when you're starting to learn Scripting and FileMaker. Are Script Steps and also the Script Maker dialog menu. All of the scripts for a given database file are listed in the managed scripts window. And you can get to that by going in under your Scripts Menu, and choosing Manage Scripts. And then, you'll see the Manage Scripts window appear. You can also get to it under File>Manage>Scripts, just like everything else that has Manage before it. The first thing you'll notice is that any new file that you open up don't have any scripts created.
It's your job as the developer to add scripts as necessary to automate repetitive tasks and to provide controls for users to manipulate the system. But when you first open up your file, you're not going to see any in there. Once you do have Scripts in your database, you'll be able to see them listed in this window. For example, if I hit the new button in the bottom left-hand corner, it will automatically create a new edit script window for us. Closing that window, will show the new script listed in our Managed Scripts window. If you have more than one script in your window, you can maneuver them into position as you can see here.
Anywhere you see a handle in any FileMaker dialog allows me to move things up and down. So here I can reorder the scripts if I want to. I can also hit Edit and change the name. And I'll be prompted to save. And even the check box at the beginning here allows me to list my scripts under the Script menu. So below Manage Scripts, I see different scripts listed here. As long as I have a check box, my users will be able to see them and select them from the list. You'll also notice is that there's a quick key that corresponds to each script name.
These quick keys will show the number in which they're listed in Manage Scripts. However, it'll only show single digit numbers, so you'll only be able to have a quick key assigned to up to nine different scripts in your system. Each time you create a new script, you'll see that it gives the name New Script. Now, if you don't go ahead and implicitly name the script something, you'll end up with a bunch of scripts that are called New Script. It's your responsibility to name the script, and it's a good idea to name it something that makes sense to you when you try to retrieve it later. So, make sure to give your scripts a name that makes sense. Inside the Edit Script button, you see the very first thing you do is name it or rename your script.
Now something interesting about the Edit Script window is you can have as many of these windows open as you want. This could be another area where not having your scripts named could be confusing. Because you can see under the window menu, that you can navigate back and forth to different Edit Script windows. And you can have as many of these windows open as you wish. You can even have them open while your database is accessible. This allows you to work on scripts without locking out the rest of your database. Back in the Edit Script window, you can see that the Edit Script window is made up of a list of all the different script steps that are available to you.
As well as an area where you can author your scripts. You'll author your scripts from the top down, implying the order of operations of your script. And most of the time, you're going to create scripts that have more than one script step. You can pick multiple scripts from the left hand side, create it in the order that you'd like. And some of these scripts will actually have additional script options. You'll end up seeing the additional script options appear down here is this gray area. You can see that the scripts are also broken down by category inside the View Script list, Control, Navigation, Editing and so on.
As you become familiar with these different scripts, you'll know where to find them in the list. But as you're starting to learn them, it might be helpful to group them by category. The other thing that you notice in the bottom left-hand corner, is that we have a Show Compatibility drop-down. FileMaker scripts can be run on Macintosh, Windows. Or executed automatically on the FileMaker server or even in iOS in your iPad or iPhone, for example. Scripts are also supported in customer web publishing for php or XML, and in FileMaker's WebDirect browser deployment.
But now all scripts are supported in those different environments. So for example, if I choose WebDirect. I can scroll through my different field lists. And see all the ones that are black are the ones that are supported on WebDirect and the ones in grey are not. And usually there's some pretty sensible reasons why some of these script steps aren't supported in these different deployment environments. A lot of it has to do here with the fact that FileMaker WebDirect. Runs in a browser, not FileMaker, so we can't save things as Excel, or PDF, because we don't have those drivers installed in the browser. Also, we don't have control over Windows when we're in a web browser like we do in FileMaker for example.
You'll also notice something under the new drop down, which is called Default Script. The Default Script will contain three default script steps. This feature was actually brought back from very old versions of FileMaker where every time you created a new script, you'd have these three steps. But now, the script will contain the three most recent actions you performed. So if you navigate to a layout, perform a search, and do a sort for example. You'll see go to layout, perform find, and then sort. This can be a handy way to help you start creating scripts by just performing the actions.
Then going into your ScriptMaker dialog and hitting default script. Once you have several different scripts in your Manage Scripts dialog window, you can also start to organize them. You'll notice under this drop down, in addition to creating a new empty script or default script. You also have the ability to create a folder. For example, you can keep all of your report scripts into a folder called Reports. And much like you see in other FileMaker interfaces, you can drop these scripts into the folder, by dragging and dropping. Where you see the little pinhole show up, indented. And also like in other managed dialogs, you can also filter by the folder name.
Or when you get very long lists of scripts you can just use the filter right here in the upper right hand corner. The rest of the buttons on the bottom are pretty self explanatory. Delete allows you to remove scripts, and of course, you're asked to confirm whether or not you want to remove them before it deletes it. And, over here, this series of buttons, for example, allows you to duplicate an existing script, so you can open it up and edit it. And, make changes from the original. That you'll find you'll be using quite a bit. Because, a lot of times, scripts are very similar in fashion, but just have very subtle differences between the two.
Here, you can actually print your entire script to a hardcopy if you want to. And that's not a bad way to back things up or if you just want to look at scripts on a piece of paper. This button here allows you to import scripts from another database. So, for example, I can hit Import, and I can navigate to a different database like Invoices_18_03. And it shows me all the different scripts available in that database. So I can pick anything from folders to scripts, check anything I want, and then I can import them in.
FileMaker then gives me an import summary that tells me whether or not we've completed the import. How many different scripts are imported and then it tells me number of errors. It's important to look at some of the errors, because for example,. Like in this script, we don't have any errors which is nice. But if we look through a few of these, we'll see there's going to be things like field references that now say table missing. And those mean that we don't have the same field name in our new file. We're going to have to go and make those corrections where we can actually use those scripts. And finally, when we do have scripts in the list. One of the ways we can test them is by going to this script trigger in the bottom right hand corner and saying perform script.
This will actually run the script allowing us to test it. But its not that common that your running scripts for production purposes, inside the manage scripts window, mostly just for testing. Once you've gotten familiar with the Manage Scripts dialog, it's time to understand how the Edit Script window works. And in upcoming movies in this chapter, we'll take a look at building some sample scripts inside the Edit Script windows.
- Creating databases from Starter Solutions
- Determining what tables you need
- Defining key fields and creating relationships between tables
- Creating fields
- Creating, duplicating, editing, and deleting records
- Importing and exporting data
- Managing layouts and layout objects
- Using the Layout Assistant
- Applying themes to layouts
- Finding records and working with found sets
- Building reports and charts
- Exploring calculations
- Creating and triggering scripts
- Working with relationships in scripts, calculations, and charts