6 Replies Latest reply on Sep 10, 2015 12:49 AM by Nehme

    Autofill

    Nehme

      Hello,

       

      I am considering the following:

      Making a table with 2 fields:

      1- Abbreviation

      and

      2- The abbreviation details (detail)

       

      When I am writing in another table, in a large text field:

      Is there a way to capture a written abbreviation and convert it directly the detailed text

       

      exp: If I write "OR", it converts it to "Operational Report"

       

      (Somewhat similar to the Microsoft Word : it automatically corrects written errors to the exact word)

       

      Hope I was clear

      I am using Filemaker 13 Pro Advanced

       

      Thanks

        • 2. Re: Autofill
          Nehme

          Typinator is in fact another software.

           

          Is there a way to do it in Filemaker?

           

          I was thinking of using some sql calculation to extrapolate the required info.

           

          But the problem is in triggering the script

          I was thinking using controller keys for triggering (like Ctrl)

           

          Is there a better way?

          And can you suggest an sql calculation (because I am new to sql)

          • 3. Re: Autofill
            electon

            I think the sql part is not the most difficult part.

            For this I'd devise some sort of in memory cache like a global variable for the values to gain speed.

             

            Getting the start and end position of the abbreviation in the text is the challenge.

            Unless you're willing to process the whole text looking for occurances of all possible abbreviations...

             

            You need to extract the word from the text to perform a comparison with your table.

            Also you will need to know the start and end position of that word.

            I haven't figured this one yet.

             

            Then you can perform

            Set Selection(start ; end) and clear that text,

            Insert Calculated Result () pastes the retrieved description at the cursor in place.

             

            Triggering with OnObjectModify:

            Get ( TriggerModifierKeys ) will allow you to look for the extra key. Possibly that combination would be ALT + SPACE.

            CTRL + SPACE does not advance the cursor hence no modification, no trigger.

             

            Just thinking out loud about how I would approach this.

             

            If everything goes well, then performance testing will show if it's not a hinderance.

            • 4. Re: Autofill
              Nehme

              Finally I managed to do my first sql script

              This is thanks to the SqlExplorer file

               

              This was the difficult part for me.

              It is not as difficult as I thought after all.

               

              Still the part of triggering part which for sure must be with OnObjectModify.

              And the easy part of it would be that the last word being typed (not the last word in the text) must only be evaluated.

              So this must not be a problem with the cursor position.

              Still I must think about the best trigger to use.

              • 5. Re: Autofill
                electon

                Possibly storing / appending each character as you type to a global variable and resetting it if the key combination is not triggered might work.

                Perhaps triggering off of OnObjectKeystroke. Get Trigger Keystroke and Get Trigger Modifier Keys should help with that.

                 

                Sent from my iPhone

                • 6. Re: Autofill
                  Nehme

                  Problem solved:

                   

                  I used the sql to take the correct value from the abbreviation list

                  No global variables needed

                   

                  I used the trigger ( OnObjectKeyStroke ) , with the script step: Code ( Get ( TriggerKeystroke ) )

                  This can detect any key on the keyboard depending on the code

                  And this can initiate my script to replace the Abbreviation in my text with the Details