12 Replies Latest reply on Feb 5, 2013 1:31 AM by khk166@gmail.com

    How do I stack commands in object scripts?

    khk166@gmail.com

      Hello,

       

      How do I stack commands, not in scripts, but in object scripts?

       

      For example, I would like to have the commands:

       

      Proper("No")

      Case(Flag = ""; "No";"Yes")

      TextColor(Phonebook::Flag;RGB(0;255;0))

       

      Not necessarily in any specific order.

       

      I have an text object named "Flag" that I'd like to apply these commands.

       

      Obviously, Filemaker can take one command, but how do issue multiple commands in this instance?

       

      Thank you,

       

      Ken

        • 1. Re: How do I stack commands in object scripts?
          pthomas

          Hi Ken,

           

          Can you please provide a little bit more information, I am not sure exactly what you mean when you say "object scripts"?

           

          Are you meaning conditional formatting on an object? Or turning an object into a button? Something else?

           

          Maybe walk me through how you are creating/applying one?

           

          Cheers,

           

          Paul.

          • 2. Re: How do I stack commands in object scripts?
            khk166@gmail.com

            Hi Paul,

             

            Thanks for your reply and please excuse me for the delay in replying to you.

             

            I suppose I am somewhat obscure in my question. Let me try to explain:

             

            I have a script that contains the following:

             

            several "if" statmemts, case statements, go to layout statements, etc. As

            you know, when you write these commands in Filemaker, you get a button

            which says, "Specify". Sometimes it may want you to specify the target

            field. Let's take for example, "Go to layout". The specify button asks me

            to define a layout and if I choose to do so by calculation, Filemaker opens

            an editor. In this editor, I enter the name of a layout. Here is the basis

            of my question. Once I enter the name of the layout in the editor, I would

            like to put another command (or more) on the next few lines. It doesn't

            matter what the commands are, but let's pick one like "Textcolor".

            Is there a way for me to stack commands in this editor, like maybe with a

            semi-colon at the end of each statement, or something?

            Anyway, thank you very much, Paul. I hope I explained it so that it's

            understandable and makes some sense.

             

            Ken

            • 3. Re: How do I stack commands in object scripts?
              pthomas

              Ok I think I have a better idea of your question.

               

              I don't believe you can stack commands like you are wanting to - It looks like you are wanting piggy back some commands off a single command.

               

              So where you say "Go to Layout X" you then want FileMaker to go to the layout and then do some other stuff, without having to specify each of the new requests in a separate command is that right?

               

              I'm not really sure why you would want to do that and not just specify each of your requests on their own?

               

              Do you have a real world example of what you are trying to achieve? There may be another way to get your desired result...

              • 4. Re: How do I stack commands in object scripts?
                ch0c0halic

                Nope.

                 

                The Go To Layout[] script step is typically used in the Browse or layout modes to go to an already existing layout of further processing. The Go To Layout lets you define which layout to go to using a calculation. It does not allow you to "design" a new layout.

                 

                The "Editor", as you refer to it, is for that calculation only, nothing more.

                • 5. Re: How do I stack commands in object scripts?
                  Malcolm

                  Let's take for example, "Go to layout". The specify button asks me

                   

                  to define a layout and if I choose to do so by calculation, Filemaker opens

                   

                  an editor. In this editor, I enter the name of a layout. Here is the basis

                   

                  of my question. Once I enter the name of the layout in the editor, I would

                   

                  like to put another command (or more) on the next few lines.

                   

                  You are able to create any valid calculation in this editor. The calculation will return a result which will then be used, in this example, to go to a layout. Calculations can do a variety of things, eg, a LET statement could set local and global variable values, and it could trigger external functions but it can not execute script steps.

                   

                  malcolm

                  • 6. Re: How do I stack commands in object scripts?
                    LyndsayHowarth

                    You are looking for 'routines'.

                     

                    FileMaker has a few tools as mentioned above like: calculations, variables, conditional formatting, scripts, custom functions, script triggers etc and you can also deploy plugins.

                     

                    But your 'routines' are more like you are trying to build query layouts on the fly which has already been pointed out is not possible.

                     

                    What IS possible is some pretty powerful database features that is limited only by your imagination and your knowledge of FIleMaker.

                     

                    Using SQL and PHP and XML you can talk to FileMaker and in combination using HTML, CSS and Javascript within Web viewers or as web browers solutions... there is not much that you can't do.

                     

                    Quality database design takes time. 20+ years to be exact. Once the basics are mastered you can build a library of time-saving features which will match the sort of thing you think you are going to achieve with 'routines'.

                     

                    - Lyndsay

                    • 7. Re: How do I stack commands in object scripts?
                      khk166@gmail.com

                      Hi Malcolm,

                       

                      Thank you very much for your reply. It, along with others, was very helpful.

                       

                      Ken

                      • 8. Re: How do I stack commands in object scripts?
                        khk166@gmail.com

                        Hello,

                         

                        Your first statement of "nope" was most helpful. It was concise and to the

                        point. It told me that my question was not possible.

                         

                        I do realize, however, that I would not be able to design a new layout in

                        the editor.

                         

                        Thanks much for your reply.

                         

                        Ken

                        • 9. Re: How do I stack commands in object scripts?
                          khk166@gmail.com

                          Hi Paul,

                           

                          Thanks again for you replies, as well as the others.

                           

                          I have decided that instead of trying to re-invent the program, I'll just

                          use Filemaker as designed. It'll be much more productive that way.

                           

                          Ken

                          • 10. Re: How do I stack commands in object scripts?
                            khk166@gmail.com

                            Hello Lyndsay,

                             

                            Yes, you hit the nail on the head. Routines, is exactly what I was looking

                            for. Really, one of the beauties of Filemaker is the how flexible its

                            language really is. Especially, when you compare it to something such as

                            4D. I spent 10 years at the helm of the 4D dashboard, so Filemaker is a

                            breeze!

                             

                            Anyway, thanks for your answer. I have many more questions and hopefully

                            you and the others can help in the future.

                             

                            Ken

                            • 11. Re: How do I stack commands in object scripts?
                              ch0c0halic

                              I'd suggest when initially asking a question that adding an explanation of what you are trying to accomplish would be very helpful. Also if you've tried various things already let us know so we don't rehash old ground. And listing a few system stats makes a big difference in the way we answer.

                               

                              Version of FMP (if missing we usually assume the latest version - 12.0v3)

                              Is the file Stand alone (on your computer) or hosted (on FMS or FMP)

                              If Hosted is it over LAN or WAN

                              Operating System and version

                              Are you using any plugins or would you be willing to for a solution?

                               

                               

                              Ch0c0halic, FileMaker 12 Certified Developer

                              FileMaker Developer Conference 2013

                              August 12-15 • San Diego,  CA

                              http://www.filemaker.com/developers/devcon/

                              • 12. Re: How do I stack commands in object scripts?
                                khk166@gmail.com

                                Got it and will do. You've been very helpful.