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

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

Recommended Posts

Posted

I'm am trying to set up a simple navigation system that stamps local globals with filename, layoutname and current tab (using its object name), so I can return to it from other locations in my solution.

I have created 3 fields, current_filename, current_layout and current_object. I created a script which sets these fields using the appropriate function, Get (filename), Get (layoutname) but Get ( ActiveLayoutObjectName ) doesn't populate the "current_object" field.

Thanks

Posted

What object is actually active when the script is running?

Posted (edited)

A button located on the tab I am trying to get the name of. That being said, I have also tried launching it from the define scripts menu as well. I enen inserted a subscript that navigates to that tab, then set the field but that still didn't work.

Edited by Guest
Posted

As far as I know, if you click on a button over a tab, the tab never becomes active (since you've clicked on the button).

Why not just put the object name onto the script parameter?

Posted

Sorry, I meant to say that the button is on the active tab layout. Like I said, I have even tried just clicking on the tab (so it is active) and then running the script, thinking that the tab would then be left active, but to no avail. I like the idea of passing the object name onto a script parameter, but that brings us back full circle. How do I capture the object name for the tab?

Posted

Comment,

Thanks for the reference. I'm going to have to take some time to wrap my head around it but I'm sure it will reveal some wisdom I can use.

My goal is to set up a universal script that stamps the present location (from file down to the layout and tab) as the user leaves the screen and then have another script at the destination screen that uses the information to return the the starting point.

Posted

It's easy to get back to the original layout - there's a script step for this. If it's important to get back to the same tab panel selection, it might be easier to open a new window and close it at the end of the script. As for getting back to the same FILE, that might have its own set of problems.

Posted

If I go the new window route, I am going to have to do this for all scripts that navigate. I'm worried that it will get messy. (but I will give it a try)

I figure that if I can stamp the location upon entry then I can leave from that location to any new location and the information is already there.

The attached image is the script that took me right to this tab to begin with and it easilyt populates the file and layout globals upon entry. Shouldn't I be able to capture the object name of my two tabs with set field or some other way during this script as well?

Thanks

script_174.bmp

Posted

As for getting back to the same FILE, that might have its own set of problems.

But if the last step in the first script was 'the go to layout[original]' wouldn't that automatically navigate you back to the original (first) file?

Phil

Posted

If I understand correctly it is the active object changing from the tab to the button that is throwing you.

To get around this could you not place identical buttons within the tabs but give them different names? Putting the buttons within the tabs would also allow you to pass different parameters as suggested before

My 2c's

Phil

Posted

If I eliminate the button (which isn't right on the tab but within the tab)and just use a script, I still can't get "Get ( ActiveLayoutObjectName )" to work. At which point in a script can you invoke "Get ( ActiveLayoutObjectName )" so it captures that name of the tab.

In my script (see attachment), when I go to resources tab, wouldn't this tab be active and shouldn't I be able to capture its object name at this point?

Thanks

script_174.bmp

Posted

Good idea, but a little more complicated when visiting external files but still leaves my original problem unsolved.

The specific challenge I am having is getting back to the original tab or subtabs within that file and layout.

Thanks

Posted

OK

I have never done this but I do not see why it wouldn't work:

2 tabs - named 'one' and 'two'

2 buttons

1 global field (G_tab)

both buttons run same script but pass a different script parameter.

click button one

run script - script parameter 'one'

click button two

run script - script parameter 'two'

script (pseudo)

Set field G_tab;Get(ScriptParameter)

[color:blue]go off and do whatever script steps (other than HALT SCRIPT) you want to do in this file or any other.

Go to layout [original]

Go to layout object[G_tab)

My theory is that a script like the above would take you back to the original layout and the original tab. I am presuming that you can go to a layout object named within a global - sorry if this is not the case but I do not have the relevant copy of FM with me to check.

Hope it works for you

Phil

Posted

I still can't get "Get ( ActiveLayoutObjectName )" to work.

I believe you have missed the point of my first post. Which object (if any) is currently the active object on a layout is one thing. Which panel of a tab control object is the front panel is another thing altogether.

If your purpose is to restore the tab control state, Get ( ActiveLayoutObjectName ) will not help you. A panel can be in front without being selected, and, more importantly, even without containing the active object.

Posted

If your purpose is to restore the tab control state, Get ( ActiveLayoutObjectName ) will not help you. A panel can be in front without being selected, and, more importantly, even without containing the active object.

Comment,

I see what you are saying here. If this is true, how can I get Filemaker to cough up the name of my "Resources Tab" which has been given the ojbect name "Recources Tab"?

Posted

Sorry Comment, I missed it the first time but that looks like it will do the job. I've never set up a custom function.

My guess is that I set up a calc field called layoutObjects using the input calculation listed.

Then define a new function called FrontTabs and past the calculation in the bottom window.

Is that correct?

Posted

You can use a custom function like any other function - in a calculation field, in a script, or anywhere else where Filemaker accepts a formula - but you need to define it first (File > Define > Custom Functions...).

However, I'd urge you to take the custom function apart, understand how and why it works, then write your own implementation. I only pointed to it because it shows (a) how to get the names of layout objects and (:) how to determine which panel is in front.

  • 2 weeks later...
Posted

Keep in mind that layout objects (and the GetLayoutObjectAttribute function) were not introduced until FileMaker 8.5, so the custom function you linked won't work for Mif if his profile is correct (FM8).

(Michael, your profile says FMP7?!)

  • 1 month later...
Posted

This problem is driving me crazy. What am I not getting here.

How can I obtain the object name of an active tab?

I want to place it into a field called "current_object"

(sample object name = "actions tab")

Posted

With the version you have can't you have a field which act as relational key, that eagerly enough freshens to your clicking on an arbitrarily chosen tab, you would need the web-viewer for that.

You're bound to reverse the entire scenario, have a masked set of tabs where button's attached scripts takes you to the various panes instead

http://www.fmforums.com/forum/attachment.php?attid/8775/

--sd

Posted

This is still not making sense to me. I can create a script that takes me to "actions tab" without any problem so clearly Filemaker recognizes that object name. Am I misinterpreting the purpose of Get (ActiveLayoutObjectName) All I want to do is have it tell me the name of the object when it happens to be a tab.

By the way, my purpose here is to leave a trail as to where I have come from so I can navigate back to it.

Posted

Yes, slightly ....you would need an action such as a script where the Get (ActiveLayoutObjectName) plays a role, expecting an unstored calc'field or autoenter update to reflect changes made by the user is too far fetched, only changes to fields can really be monitored that way...

This means the suggestion I gave not is far from what you wish to acheive, you make a logging field or $$variable to store which of the tabs you have in front of you prior to the scripting, taking you to the next.

--sd

Posted

This is still not making sense to me. I can create a script that takes me to "actions tab" without any problem so clearly Filemaker recognizes that object name. Am I misinterpreting the purpose of Get (ActiveLayoutObjectName) ?

Yes you are misinterpreting the meaning of an active object.

An object is active ONLY if it contains the cursor. That means a field you have entered; or a button or object that is in the tab order and that you have tabbed to.

A clicked object is NOT an active object.

You are looking for frontmost tab, a different property. Note that if you have nested tabs then you need a recursive custom function to figure out which is the real frontmost tab.

Posted

I need to go back to the original enquiry.

How do I capture the object name for any tab that has been given one?

Filemaker Help under "Get (ActiveLayoutObjectName) says:

"Description

Returns the object name of the active layout object in the calculation's current window. Otherwise returns an empty string. "

If I run a script that goes to a tab using "Go to object" script step is that not the active object and shouldn't I be able to get that object name using the Get (ActiveLayoutObjectName) function?

Posted

If I run a script that goes to a tab using "Go to object" script step is that not the active object and shouldn't I be able to get that object name using the Get (ActiveLayoutObjectName) function?

No. Going to a tab panel will make it the front panel, but not active. The only way to make it active is by tabbing to the tab control object (assuming it's included in tab order). Then the currently front panel will become active.

This topic is 6227 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.