Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 8718 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

In version 4 of filemaker you could display a message via AS that would show a field value and a button choice, is that possible with 5 and how is it done.

Cheers

Coops

[This message has been edited by Coops (edited January 09, 2001).]

Posted

There shouldn't be any difference between how you do it in FMP4 and how you do it in FMP5. Did you have an AppleScript that broke when you upgraded the file to FMP5?

display dialog "Which name?" with buttons { (cell "First_Name" of current record of layout 0 of database "Names.fp5"), (cell "Last_Name" of current record of layout 0 of database "Names.fp5") } default button 1 with icon 2

Chuck

[This message has been edited by Chuck (edited January 09, 2001).]

Posted

Thanx Chuck, It sort of helps as I know diddly squit about AS.

I had an inherited file that worked in 4 but not in 5 all it displayed was ^0 in the message box, as I no longer have that file I can't give you more info, Sorry.

What I want to do is display a dialog with a field value in the message choice from a database called dictionary, I then want to display two button choices and then get filemaker to respond in two different ways depending on button choice, Possible?, can u help?

Appreciated

Coops

[This message has been edited by Coops (edited January 10, 2001).]

[This message has been edited by Coops (edited January 10, 2001).]

Posted

Coops,

Here's how you would construct the AppleScript.

display dialog ("Your dialog message here " & cell "Field_Name" of current record of layout 0 of database "dictionary") buttons {"Choice1", "Choice2"} default button 1 with icon 1

set (cell "gDialog_Button" of current record of layout 0 of database "dictionary.fp5") to button returned of result

This AppleScript does two things. First is shows a dialog box that has as its message "Your dialog message here <field contents>" where <field contents> is the contents of the field Field_Name in the database dictionary and in the current record. Make sure that the database name is exactly what it is called. For instance, if there's a .fp5 extension after the word dictionary in the file name, make sure that the script refers to the file this way. The dialog box then shows two buttons, "Choice1" and "Choice2" with the default button being "Choice2" (chosen if the enter key is pressed and shows up with a thick border in the dialog box.

The second line takes the button selected and places that value (either "Choice1" or "Choice2") into a global text field (which you'll need to create in FileMaker).

Here's how you use this AppleScript in FileMaker. Create a new FileMaker script and use the following steps:

Perform AppleScript [ <enter the script above> ]

If [ gDialog_Button = "Choice1" ]

This topic is 8718 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.