ISO FileMaker Magazine: FileMaker Video Tutorials, Templates, Help & More

Navigation

FileMaker Deals

Video Browser

Scriptology Video Browser

Tools & Resources

Get (ActiveLayoutObjectName)

Posted by: MaxR / Wednesday, May 16, 2007 – 6:19pm

Using Object Info I assigned a name to a graphic button but Get(ActiveLayoutObjectName) wasn't getting it.

FMPV8.5 Online Help under Get (ActiveLayoutObjectName) says:

"Example
There is a named button on the current layout called cancelButton. When the cursor is on the button, Get(ActiveLayoutObjectName) returns cancelButton."

Further, under Notes "Naming Objects", the rules state:

"You can assign a name to an individual object or to a grouped object, but not to multiple objects. "

There is a difference between the mouse pointer and the cursor. The cursor is where the text insertion cursor is located; the object that has the "focus". So for instance if the insertion point was in field "first name" then this is the *active* layout object. A button can only become an active object if it is in the tab order and you have tabbed to it; or if a script action "go to object" has taken place.

Here is a solution:

Create two dummy fields: One, and Two (they could be globals, so you can use them anywhere) and use field One as the button, and assign whatever name you want.

Make the field a button and script as follows:

Go to Field [One]
Set Variable [ $$object; Value:Get ( ActiveLayoutObjectName ) ]
Go to Field [Two]

Field two is not on the layout so the effect of the third step is to exit the One field. Now $$Object contains the object name and the script can continue.

You can place a passive text block on top to name the "button."

------
Max Rogalsky
Melbourne, Australia
www.maxiwyse.com.au

Filed under:
-