5 Replies Latest reply on Feb 3, 2014 4:56 AM by mcrostie

    On Object Exit issue

    mcrostie

      Hi All

       

      I have a "OnObjectExit " script that runs as intended.

       

      I wish to automate it further (another script step maybe?) so the curser will exit the object and run (without me clicking outside the object)

       

      Hope this is a clear enough explaination

       

      Regards

       

      Michael

        • 1. Re: On Object Exit issue
          Mike_Mitchell

          Under what circumstances do you want it to exit the object?

          • 2. Re: On Object Exit issue
            wimdecorte

            mcrostie wrote:

             

            exit the object and run

             

            I don't understand this:

             

            1) since the event that triggers the even is "exit" the cursor will not be in the field when your script finishes.  Unless you block the event.

             

            2) "run" what?

            • 3. Re: On Object Exit issue
              mcrostie

              Hi Mike

               

              I have a "OnRecordLoad" on a layout which is setting a text field with a $variable. Thats where it stops and waits for me to manually exit the text field

              • 4. Re: On Object Exit issue
                Mike_Mitchell

                I'm not entirely sure what you want to accomplish, but ... if you want to execute the OnObjectExit script after the variable is set, why not just do that in your OnRecordLoad script?

                1 of 1 people found this helpful
                • 5. Re: On Object Exit issue
                  mcrostie

                  Hi Wimdecorte

                   

                  My on object exit starts a Loop script, which resizes the text in the object (text field - ObjectName 2)

                   

                  I have copied the script if this may help

                   

                  Group Scripts: AutoResize ( OnObjectExit ) for a named object: 2

                  Loop

                  Set Variable [ $$IsRunning; Value:1 ]

                  Set Variable [ $fontSize; Value:Let([

                  css = GetAsCSS ( Get ( ActiveFieldContents ) ) ;

                  pStart = Position ( css ; "font-size" ; 1 ; 1 ) + 10;

                  pEnd = Position ( css ; "px;" ; pStart ; 1 ) ;

                  size = Middle ( css ; pStart ; pEnd - pStart )

                  ];

                  GetAsNumber ( If ( IsEmpty ( size ) ; 14 ; size ) )

                  ) ]

                  If [ $fontSize ≤ 6 or GetAsNumber ( GetLayoutObjectAttribute ( 2 ; "Height" ) ) ≤ $$Height ]

                  Set Variable [ $$IsRunning; Value:0 ]

                  Exit Script [ Result: 1 ]

                  Exit Loop If [ $$IsRunning =0 ]

                  Else

                  Set Field [ TextSize (Get ( ActiveFieldContents ) ; $fontSize - 1 ) ]

                  Commit Records/Requests

                  [ Skip data entry validation; No dialog ]

                  Go to Object [ Object Name: 2 ]

                  End If

                  End Loop

                  Commit Records/Requests

                  [ No dialog ]