1 Reply Latest reply on Apr 24, 2012 12:15 PM by Stephen Huston

    get ( ActiveFieldName) not working

    strngr12

      Can anyone tell me why this may not work? The third line doesn't set the variable $firstField. My script just jumps over this part like it's not there.

       

      Go to Layout [ “Data Entry” (Code Book) ]

      Go to Record/Request/Page[ First ]

      Go to Field [ ]

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

      Loop

      Exit Loop If [ $currentField = $activeField ]

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

      Perform Script [ “sanitize for XML”; Parameter: $currentField ]

      Set Variable [ $currentField; Value:Get ( ScriptResult ) ]

      Set Variable [ $fieldData; Value:Get ( ActiveFieldContents ) ]

      Perform Script [ “sanitize for XML”; Parameter: $fieldData ]

      Set Variable [ $fieldData; Value:Get ( ScriptResult ) ]

      Set Variable [ $xmlKeyPair; Value:"<" & $attrTag & " key=" & Quote($currentField) & ">"& $fieldData &"</" & $attrTag & ">" ]

      Set Variable [ $appendScriptLine; Value:"echo " & Quote(" Perform AppleScript [ Calculated AppleScript: "do shell script" & Quote($appendScriptLine) ]

      Go to Next Field

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

      End Loop

       

      Thanks for any help.

        • 1. Re: get ( ActiveFieldName) not working
          Stephen Huston

          Go to Field (nothing specified)  has the effect of exiting all fields, not tabbing.

           

          You appear to be relying on the Tab Order for this script to run. If you know the tab order, you could both explicitly set the first Go to Field to that field and even set the variable value explicitly without relying on the tabl order.

           

          If you need to use this on multiple layouts, then you cannot preset those values, of course.