5 Replies Latest reply on Mar 5, 2014 11:11 AM by LambdaEnt

    Current Field Variable in a Script

    LambdaEnt

      Title

      Current Field Variable in a Script

      Post

           Is it possible to use a variable in a script that will cause actions to be performed on whatever is the active field?

           A common use I have is when clicking on a field, if it's empty, then the contents of the clipboard are pasted. If not empty, the field is selected normally.

           Currently, I have been creating a separate script for each and every field. The field is a button with a Perform Script action:

      If [IsEmpty(Contact::Phone)]
               Paste [Select; No style; Contact::Phone]
           End If
           Go to Field [Contact::Phone]

            

           It would be nice if a variable with Get (ActiveFieldName) could be used. I'm envisioning this, but it doesn't seem possible:

      Set Variable [$ActiveFieldName; Value:Get ( ActiveFieldName )]
           If [IsEmpty($ActiveFieldName)]

               Paste [Select; No style; $ActiveFieldName]
           End If
           Go to Field [$ActiveFieldName]