4 Replies Latest reply on Jun 3, 2014 6:05 AM by artdoc

    Trying to "GetLayoutObjectAttribute"



      Trying to "GetLayoutObjectAttribute"


           Not critical, just frustrating! I put a new popover button on a layout, then went to demo a file for a guy who is still FM12 and found the feature didn't work on 12; I also found that the hide/show function was not working on an FM 12 machine. I wanted to create a work-around, thinking I'd move an object off-screen and then replace it with the "GetLayoutObjectAttribute", but I've tried all I could think of to get that "left" number (text). I started with a $left variable, but nothing. Tried GetasText, tried a script to set a text field, insert a calculated result,...Simply no results at all.

           I found my way around the lack of a popover button by opening a small floating window ith a single field of info, so while not as elegant (or fun!), it does work with a button to pop it up. Now if I could figure out why I can't seem to grab the object data for the left of another object, I could try moving it.. Anyone?




        • 1. Re: Trying to "GetLayoutObjectAttribute"

               In order for GetLayoutObjectAttribute to be able to access info about a layout object on the current layout, it must have been given an object name in the Inspector by using the Name box.

               But a popover actually consists of two objects--the button and the frame are two objects and each can be given a different object name.

               But a script can't modify a layout's design so this would appear to be a method unlikely to help you.

               I'd set up a start up script that uses Get (ApplicationVersion) to identify whether the user is using FileMaker 12 or 13 and take them to a different layout--one equipped with the popover button and one without. Though I suppose that you might hide the popover button inside a transparent tab control as a way to make a layout adjust for the application version--but this still would not use GetLyoutObjectAttribute but that Get function instead.

          • 2. Re: Trying to "GetLayoutObjectAttribute"

            "... it must have been given an object name in the Inspector..."

                 Ahh, comes the light! You have helped me once again, and I learned that an object can have its own name that is NOT the name of the container field (in my case) or other name from the construction lists. I named my graphic field, jiggered the script and Bingo! I have what I was wanting. Now I can experiment with moving the thing around.

                 AS for scripting to test for 12 or 13: my customer has immediately decided to upgrade his program to 13, so another sale for Filemaker.

                 Thanks for your help, 



                 EDIT: Nuts! I was so sure the next thing would be cake. Nope! I find no info on setting a new "left" attribute So I wonder, what advantage is there in doing a query on attributes? Glad this isn't a critical thing, I'm just having some fun wit new things in FM 123.

            • 3. Re: Trying to "GetLayoutObjectAttribute"

                   I did warn you that you couldn't do what you wanted to do. wink

                   layout objects can change size and position due to sliding options or auto-size anchors set for them in the Inspector. In preview mode, checking the height of a field, for example can tell you whether it is one row, two rows or multiple rows of text in height.

                   And GetObjectAttribute has been around for quite a awhile. It's not new to version 12 or 13.

              • 4. Re: Trying to "GetLayoutObjectAttribute"

                "...a script can't modify a layout's design.."

                     I misinterpreted that. I simply got interested in the new show/hide and wanted to try it. I usr conditionals to great advantage for multi-page work orders to hide some info until a last page, where the totals and such need to show. But I added a new graphic container and there was no "condition" to use.

                     I can appreciate that there are lots of script steps that I simply never have had a chance to use; I'm just enjoying learning to expand my abilities. Too bad I only really have one customer who uses my help!

                     Thanks fir the information in this question, however.