1 2 Previous Next 18 Replies Latest reply on Oct 15, 2016 6:49 PM by rouelf

    Script to open Launch Center in FM Go

    muddylanding

      I have seen this question before but never a satisfactory answer. Is there a way to script opening the Launch Center in FM Go?

        • 1. Re: Script to open Launch Center in FM Go
          beverly

          I use (script step)

          Exit Application

          on a button to take me back to Launch Center, where I have removed the status and menus.

          beverly

          • 2. Re: Script to open Launch Center in FM Go
            muddylanding

            Thanks, that will provide a reasonable work around solution even though I need both the database and the other App open at the same time to facilitate database actions from the other App via custom URLs

            • 3. Re: Script to open Launch Center in FM Go
              beverly

              Thank you for clarification on what you are trying to do!

              Do you need to go back to Launch Center from inside FMGo? The starter solutions that do not have everything locked down (as mine) have an icon in the upper left (down arrow in circle) that gives you choices:

              • Launch Center
              • Help
              • Close File
              • Save/Send As
              • Export
              • Print
              • Layout
              • Scripts
              • Settings

              beverly

              • 4. Re: Script to open Launch Center in FM Go
                muddylanding

                Hi Beverly

                Which starter solution is yours?

                • 5. Re: Script to open Launch Center in FM Go
                  beverly

                  from the install of FMGo, you get some ready-made solutions.

                  • Assets

                  • Contacts

                  • Contact Management

                  • Invoices

                  but you can take any of the many starter solutions on Desktop and send to FMGo (via email?)

                   

                  beverly

                  • 6. Re: Script to open Launch Center in FM Go
                    muddylanding

                    Hi Beverly

                    I tried your suggestion of 'Exit Application' and it is a reasonable work around. Thanks!

                     

                    What I would really like to do is just automate the clicks and taps that occur after creating the GPX file.

                     

                    1. Tap to open Launch Centre,

                    2. Tap to select 'device'

                    3. Scroll to Other file section and open file

                    4. tap to select 'copy to' other App

                     

                    I guess what would be perfect is if it were possible to script step three which would just leave step four - convenient and flexible. But I don't think that is possible in FM GO at present?

                     

                    In FM on Mac or Windows I would use Send Event. Seems to work fine sending the GPX file to Google Earth or similar application.

                     

                    It seems a bit weird to me that FM GO will open the GPX manually but can't be scripted to do this?

                     

                    It's great to have access to this forum as a learning/sharing place!

                    • 7. Re: Script to open Launch Center in FM Go
                      beverly

                      so then, really, you want a Save/Send As with an OPEN WITH? How are you creating the GPX file from FMGo?

                      what app are you trying to open?

                       

                      post script if needed

                      beverly

                      • 8. Re: Script to open Launch Center in FM Go
                        muddylanding

                        Yes Beverly that's pretty well it.

                        The GPX file is created by looping through the found set and building a long text string from the data (mostly Latitude, Longitude and description data) in a field which is then exported, in this case to the desktop (Launch Center Other Documents in GO)

                        This is working well.

                        I am copying the GPX file to a nice offline mapping App called Galileo. This works fine as well.

                         

                        The issue is the messing about "opening" the GPX file in the Launch Centre and ending it to Galileo which involves an excessive number of taps/clicks/selection from dropdown menus. In other words the sending of the file is a completely manual operation.

                         

                        GPX looks like this:

                         

                        <gpx Version="1.0">

                        <time>15/10/2016 2:22:59 AM</time>

                        <wpt lat="46.784" lon="17.18728">

                        <name>Heviz Free Camping</name>

                        <desc>fmp://~/2018%20Diary?script=GalileoLocationFind&param=43</desc>

                        <type>BookmarkStyle_3</type>

                        </wpt>

                        <wpt lat="47.03585" lon="18.10814">

                        <name>Balatonkenese Free Camping</name>

                        <desc>fmp://~/2018%20Diary?script=GalileoLocationFind&param=44</desc>

                        <type>BookmarkStyle_3</type>

                        </wpt>

                        <wpt lat="47.51064" lon="19.04572">

                        <name>Budapest Free Camping</name>

                        <desc>fmp://~/2018%20Diary?script=GalileoLocationFind&param=45</desc>

                        <type>BookmarkStyle_3</type>

                        </wpt>

                         

                        You can see the records between the <wpt> and </wpt> markup. The file contains Latitude, longitude, a name for the location, and a <desc> which contains a custom URL and is used from the App to get back to a Filemaker record by running a script with a parameter which is a record ID.

                         

                        The Galileo App displays each point on a map and allows a user to tap a point which activates the custom URL to cause a scrip to run in the database, basically just displaying the appropriate db record.

                         

                        All a bit cumbersome, but necessary I guess when working with iOS.

                         

                        All I really want to do is automate the process so that when a GPX button is tapped in the database, the data displays in Galileo without the manual process of sending of the GPX document from the Launch Center.

                        • 9. Re: Script to open Launch Center in FM Go
                          beverly

                          are you using export? can you post your script, please?

                          beverly

                          • 10. Re: Script to open Launch Center in FM Go
                            muddylanding

                            Hi Beverley

                            Here is the (edited) script I am using. It builds GPX format text in a field (Navigation:GPXData) and exports it to the desktop path as a text file.

                             

                             

                            15 October 2016 21:11:09 2018 Diary.fmp12 - CreateGPXFile(Source) -1-

                            GPS: CreateGPXFile(Source)

                            # Write a GPX file to disk

                            Set Variable [ $Source; Value:Get(ScriptParameter) ]

                            Set Variable [ $TimeStamp; Value:Get ( CurrentTimestamp ) ]

                            Set Variable [ $Header; Value:"<gpx Version=\"1.0\">¶" & "<time>" & $Timestamp & "</time>¶" ]

                             

                            If [ $Source="Overnight" ]

                            Set Variable [ $FilePath; Value:Get ( DesktopPath ) & "Overnight.gpx" ]

                            Go to Layout [ “Journal” (Journal) ]

                            Go to Record/Request/Page[ First ]

                            Set Field [ Navigation::GPXData; $Header ]

                             

                            Loop

                            Set Field [ Navigation::GPXData; Navigation::GPXData &

                            "<wpt lat=" & "\"" & Journal::OvernightStopLatitude & "\"" & " lon=" & "\"" & Journal::OvernightStopLongitude & "\">¶<name>"

                            & Journal::OvernightStop Title &" Overnight" & Journal::_Date & "</name>¶<desc>" & Journal::GalileoOverNightURL &

                            "</desc>" & "¶<type>" & "Bookmarkstyle_26</type>¶</wpt>¶" ]

                            Go to Record/Request/Page

                            [ Next; Exit after last ]

                            End Loop

                             

                            Set Field [ Navigation::GPXData; Navigation::GPXData & "</gpx>" ]

                            End If

                             

                            If [ $FilePath="" ]

                            Set Variable [ $FilePath; Value:Get ( DesktopPath ) & "Data.gpx" ]

                            End If

                             

                            If [ Get ( SystemPlatform ) = 3 ]

                            Set Variable [ $FilePath; Value:Get ( DocumentsPath ) & "LocationData.gpx" ]

                            Export Field Contents [ Navigation::GPXData; “$FilePath” ]

                            Show Custom Dialog [ Title: "Message"; Message: "A GPX file called 'LocationData.gpx' has been saved. Open it in the Launch Center and copy it to the Galileo App"; Default Button: “OK”, Commit: “Yes” ]

                            Exit Application

                            Else

                            Export Field Contents [ Navigation::GPXData; “$FilePath” ]

                            End If

                            • 11. Re: Script to open Launch Center in FM Go
                              rouelf

                              muddylanding, though this discussion is marked as answered, maybe there is a better answer yet not given.

                              It seems that what you are asking is for a solution running in FM Go, to tap a button that runs a script that performs all of the following:

                              1) Generate the gpx data, and

                              2) Open another iOS App, Galileo, and

                              3) Pass the gpx data to Galileo for display.

                               

                              You have accomplished 1 above, that is great. I think that 2 and 3 maybe doable in the script, using the proper URL Scheme with The Open URL script step.

                               

                              Unfortunetly, I have don’t have the know to do that, yet.  Look at the YouTube link below, it indicates that some experts open other iOS apps and pass data back and forth to an FM Go solution.

                               

                              URL Schemes:

                              https://www.youtube.com/watch?v=eg1lwELvfZI

                               

                              Hopefully, some expert will chime in on how to set up the URL Scheme to make this work.

                              • 12. Re: Script to open Launch Center in FM Go
                                beverly

                                OK Export field contents...

                                Are you checking "Automatically open file"? or not in the Export Field to file dialog?

                                 

                                beverly

                                1 of 1 people found this helpful
                                • 13. Re: Script to open Launch Center in FM Go
                                  rouelf

                                  beverly, good call, it works great on desktops; however, with FM Go, does not tell which iOS App should open the gpx data. I think one needs to use Open URL.

                                  • 14. Re: Script to open Launch Center in FM Go
                                    rouelf

                                    beverly, until I figure out how to better use URL Schemes with Open URL, Your suggestion to check “Automatically Open File” is great. I have my file in a container, then when The the script step runs, it eports the file to the Launch Center, Device, and opens a screen with the file name, and at bottom left, the FM Go export button, which we can use to select which app to open the file with.  This is great for the time being !!

                                    1 2 Previous Next