VISUAL QUICKPRO GUIDE FileMaker Pro 7 Advanced FOR WINDOWS AND MACINTOSH [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

VISUAL QUICKPRO GUIDE FileMaker Pro 7 Advanced FOR WINDOWS AND MACINTOSH [Electronic resources] - نسخه متنی

Cynthia L. Baron, Daniel Peck

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید











Using Script Parameters for Multipurpose Scripts


A major reason to build scripts is to automate repetitive tasks. But script writing itself can become repetitive. FileMaker Pro 7 takes a significant step toward scripting freedom with the addition of the Script Parameter function. It allows you to perform one script using different criteria, depending on how you call the script. As a result, you can write a single script for multiple purposes.

In this example, we write a single script that attaches to buttons that navigate to different layouts. The script uses a Go to Layout step, with the layout name specified as the script parameter.

To create a multipurpose script



1 .

Choose Scripts > ScriptMaker (Control+Shift+S/Command+Shift+S).

2 .

When the Define Scripts dialog box appears, click New. In the Edit Script dialog box, type Go to Different Layouts as the script name.

3 .In the script step list, double-click Go to Layout. In the Specify drop-down list in Script Step Options, choose Layout Name by calculation (Figure 9.66).

Figure 9.66. The Layout Name by calculation option allows you to choose a layout using the script parameter.


4 .In the Specify Calculation dialog box, choose Get functions in the View drop-down list. Scroll down the Get functions list to Get(ScriptParameter) and double-click it (Figure 9.67). Click OK three times to finish.

Figure 9.67. In this example, Get(ScriptParameter) returns the name of the specified layout.


[View full size image]

5 .

Go to the layout on which you want to add the navigation button. Choose View > Layout Mode (Control+L/Command+L).

6 .

In the toolbar in the status area, click the Button tool. Drag a rectangular box on the layout to create a button.

7 .When the Specify Button dialog box appears, click Perform Script to select it. In the Options section on the right, click Specify.

8 .When the "Specify Script" Options dialog box appears, click the Go to Different Layouts script. In the Optional script parameter section, type the name of the layout you'll go to when the button is clicked (Figure 9.68). Click OK twice.

Figure 9.68. The text in the script parameter must match the layout name.


9 .

On the layout, type a name for the button.

10 .Select the button, then hold the Control/Option key and drag the button to duplicate it. Give the button a new name, then double- click it.

11 .When the Specify Button dialog box appears, click Specify in the Options section. In the Optional script parameters box, change the previous layout name to the layout name for this button (Figure 9.69). Click OK twice.

Figure 9.69. Changing the text in the script parameter option changes the layout the button targets.


12 .Repeat steps 10 and 11 for as many buttons as you need.

13 .Choose View > Browse Mode (Control+B/Command+B). Click on each of the new buttons to test that they connect to the correct layouts.



Window Script Options


When you're scripting, you can take control of the FileMaker window by using a Windows script. Doing so allows you to improve your users' experience, and helps you keep your database window looking and feeling consistent no matter which platform it's viewed on.

Windows script steps control every aspect of the window experience, from Set Zoom Level, which lets you set the magnification of a window to a defined percentage, to Set Window Title, which allows you to rename any window using custom text.

Adjust Window is a particularly flexible step, with many options to customize window behavior:

Minimize.
Turns the window into a Task Bar icon (Windows) or Dock icon (Macintosh).

Hide.
Makes the current database window invisible. This is equivalent to choosing Hide Window in the menu bar.

Maximize.
Resizes the window to fill the full screen.

Restore.
Returns the window to the size it was before minimizing.

Resize to Fit.
Adjusts the size of the windows to show all of the elements (fields, text and graphics).


Perhaps the most powerful option is Move/Resize Window, which allows you to specify exactly how big the open window will be and where it will appear, allowing you to save space on small screens or position a window at a specific x/y coordinate (Figure 9.70).

Figure 9.70. By defining the window size and x/y coordinates of the States window, you can precisely position the window on the screen.



/ 227