Jump to content
Sign in to follow this  
Woodelf

Displaying AppleScript Messages?

Recommended Posts

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).]

Share this post


Link to post
Share on other sites

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).]

Share this post


Link to post
Share on other sites

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).]

Share this post


Link to post
Share on other sites

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" ]

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Who Viewed the Topic

    1 member has viewed this topic:
    cfmartinez1090 
×
×
  • Create New...

Important Information

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