<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Script to record GPS metadata? in ArcPad Questions</title>
    <link>https://community.esri.com/t5/arcpad-questions/script-to-record-gps-metadata/m-p/50160#M374</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you thought about hitting a button to start the averaging, then another when ready to stop and also have it bring up the form.&amp;nbsp; You could write the average location to an&amp;nbsp; Application.UserProperties(“yourTempVariable”) until you finish your form, then write all to the shapefile (or whatever you are writing to).&amp;nbsp; That is similar to how we mark an animal location from the plane, but allow the biologist to fill in the data afterwords.&amp;nbsp; We are only collecting the one point, but they could be miles away before they have the form complete.&amp;nbsp; I capture the point of the click, but you could do something similar with an average, I would assume.&amp;nbsp; I also have a running average speed which is capture for 60 seconds “before” they hit the button….I’m not sure how easy it would be to do a running average of locations (also have many distance counters, some which reset based on other button action).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 May 2016 16:10:50 GMT</pubDate>
    <dc:creator>RebeccaStrauch__GISP</dc:creator>
    <dc:date>2016-05-05T16:10:50Z</dc:date>
    <item>
      <title>Script to record GPS metadata?</title>
      <link>https://community.esri.com/t5/arcpad-questions/script-to-record-gps-metadata/m-p/50158#M372</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've been working with Jeff LeProwse's AddXYZ+ applet to record GPS metadata with each point collected. I'm at the point where I'm in over my head as far as figuring out the coding.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've set up ArcPad 10.2.2 to average 30 seconds of observations per point. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Problems with the script:&lt;/P&gt;&lt;P&gt;1. The applet uses onFeatureAdded which means the GPS metadata is recorded when OK is pressed to create the new point and not when the GPS finishes collecting the coordinates. So if you stand in the road for 30 seconds while the GPS collects the point and then move to the side of the road for 5 minutes filling in forms and press OK the GPS metadata is recorded for wherever you were standing at that moment, not out in the road.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. For existing points the GPS metadata is updated onFeatureUpdated regardless of whether GPS is used to update the position. If the GPS is enabled and I move a point with the mouse the GPS metadata will update.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To get around this I've gone to calling the applet on GPS onAverageStop, which works when moving existing points, but doesn't for new points because there isn't an existing RecordSet to update(?) so I think populating the open EditForm is the way to go but can't get the code to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Summary: I'd like the script to record GPS metadata at the moment the GPS finishes averaging and records the position when adding new points with AddGPSPoint and moving existing points with MovePointToGPS only. Also needs to factor in the possibility of toggling between editing several point layers and a polyline layer with the QuickCapture toolbar.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Some code (which doesn't work):&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;lt;ArcPad compiled="true"&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; &amp;lt;APPLET name="AddXYZ+_RCE_fields"&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;SYSTEMOBJECTS&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;GPS onAverageStop="Call UpdateGPSFields"/&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/SYSTEMOBJECTS&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; &amp;lt;/APPLET&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;lt;SCRIPT language="VBScript"&amp;gt;Option Explicit&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Sub UpdateGPSFields&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;'Define attributes&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Dim MyCoordSys, objRS, f, strMessage, fCount, objForm, editPointLayer&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;'Get current edit point layer&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Set editPointLayer = Map.EditLayer(1)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;'Get current edit point layer EDITFORM&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Set objForm = editPointLayer.Forms("EditForm")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;'Check to see if the EDITFORM is open (3)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;'If not open, assume Move to GPS operation on selected point&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;If objForm.Mode = 3 Then&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; Application.StatusBar.Text = "EDITFORM is open"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Else&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; 'Get current coordinate system&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; Set MyCoordSys = Application.Map.CoordinateSystem&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; 'Get the RecordSet of the currently selected feature's layer&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; 'SelectionLayer returns layer of currently selected feature&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; Set objRS = Map.Selectionlayer.Records&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; 'Bookmark the currently selected record&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; objRS.Bookmark = ThisEvent.Bookmark&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; 'Check if the current shape is a point&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; If Right(objRS.Fields.ShapeType, 1) = 1 Then&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; 'Check what the coordinate system is&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; If MyCoordSys.GeographicName = "GCS_WGS_1984" Then&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; 'Loop through the current layer's fields&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; For Each f in objRS.Fields&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Select Case Ucase(f.name)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case "GPS_X" &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; f.Value = GPS.x&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fCount = fCount + 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case "GPS_Y" &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; f.Value = GPS.y&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fCount = fCount + 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case "GPS_LAT" &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; f.Value = GPS.Latitude&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fCount = fCount + 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;...&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Mar 2016 18:46:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcpad-questions/script-to-record-gps-metadata/m-p/50158#M372</guid>
      <dc:creator>MarkJohnson</dc:creator>
      <dc:date>2016-03-24T18:46:26Z</dc:date>
    </item>
    <item>
      <title>Re: Script to record GPS metadata?</title>
      <link>https://community.esri.com/t5/arcpad-questions/script-to-record-gps-metadata/m-p/50159#M373</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Were you ever able to come up with a solution? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 May 2016 14:59:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcpad-questions/script-to-record-gps-metadata/m-p/50159#M373</guid>
      <dc:creator>RobBlash</dc:creator>
      <dc:date>2016-05-05T14:59:30Z</dc:date>
    </item>
    <item>
      <title>Re: Script to record GPS metadata?</title>
      <link>https://community.esri.com/t5/arcpad-questions/script-to-record-gps-metadata/m-p/50160#M374</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you thought about hitting a button to start the averaging, then another when ready to stop and also have it bring up the form.&amp;nbsp; You could write the average location to an&amp;nbsp; Application.UserProperties(“yourTempVariable”) until you finish your form, then write all to the shapefile (or whatever you are writing to).&amp;nbsp; That is similar to how we mark an animal location from the plane, but allow the biologist to fill in the data afterwords.&amp;nbsp; We are only collecting the one point, but they could be miles away before they have the form complete.&amp;nbsp; I capture the point of the click, but you could do something similar with an average, I would assume.&amp;nbsp; I also have a running average speed which is capture for 60 seconds “before” they hit the button….I’m not sure how easy it would be to do a running average of locations (also have many distance counters, some which reset based on other button action).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 May 2016 16:10:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcpad-questions/script-to-record-gps-metadata/m-p/50160#M374</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2016-05-05T16:10:50Z</dc:date>
    </item>
    <item>
      <title>Re: Script to record GPS metadata?</title>
      <link>https://community.esri.com/t5/arcpad-questions/script-to-record-gps-metadata/m-p/50161#M375</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the replies, I ended up rewriting the script so it checks if a form is open and if it is it writes the GPS data to a custom form page "GPS" which I'm adding to all my edit forms, otherwise it assumes I'm moving an existing point and uses the selected record approach. The code is really inefficient and I ran into some other issues but it's working at a basic level.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rebecca's reply mentioning Application.UserProperties that I hadn't discovered yet gives me a whole other way to approach this that I'll attempt later when I have some time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;ArcPad compiled="true"&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;lt;APPLET name="GPS_Metadata2"&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;lt;SYSTEMOBJECTS&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;lt;GPS onAverageStop="Call GPSMetadata"/&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;lt;/SYSTEMOBJECTS&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;lt;/APPLET&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;lt;SCRIPT language="VBScript"&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Option Explicit&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sub GPSMetadata&lt;/P&gt;&lt;P&gt;' Main routine to add GPS metadata from the NMEA string to edit layers configured with GPS attributes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;' Set variables&lt;/P&gt;&lt;P&gt;Dim editPointLayer, editLineLayer&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'Get edit layers&lt;/P&gt;&lt;P&gt;Set editPointLayer = Map.EditLayer(1)&lt;/P&gt;&lt;P&gt;Set editLineLayer = Map.EditLayer(2)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'If there is an edit point layer, add/update GPS metadata if EDITFORM open or selected feature&lt;/P&gt;&lt;P&gt;If Not (editPointLayer Is Nothing) Then&lt;/P&gt;&lt;P&gt;' If the EDITFORM is open, assume creating a new point and fill in form and update GPS fields values&lt;/P&gt;&lt;P&gt;&amp;nbsp; If editPointLayer.Forms("EDITFORM").Mode = 3 Then&lt;/P&gt;&lt;P&gt;&amp;nbsp; Call FillGPSForm(editPointLayer)&lt;/P&gt;&lt;P&gt;' If EDITFORM is not open but the edit point layer has a feature currently selected update GPS fields values&lt;/P&gt;&lt;P&gt;&amp;nbsp; ElseIf editPointLayer.Name = Map.SelectionLayer.Name Then&lt;/P&gt;&lt;P&gt;' Application.StatusBar.Text = "The edit point layer matches the selection layer"&lt;/P&gt;&lt;P&gt;&amp;nbsp; Call UpdateGPSFields(editPointLayer)&lt;/P&gt;&lt;P&gt;&amp;nbsp; End If&lt;/P&gt;&lt;P&gt;End If&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'If there is an edit line layer, add/update GPS metadata if EDITFORM open or selected feature&lt;/P&gt;&lt;P&gt;If Not (editLineLayer Is Nothing) Then&lt;/P&gt;&lt;P&gt;' This won't work because form isn't open until after drawing a new polyline&lt;/P&gt;&lt;P&gt;&amp;nbsp; If editLineLayer.Forms("EDITFORM").Mode = 3 Then&lt;/P&gt;&lt;P&gt;&amp;nbsp; Call FillGPSForm(editLineLayer)&lt;/P&gt;&lt;P&gt;' If EDITFORM is not open but the edit line layer has a feature currently selected update GPS fields values&lt;/P&gt;&lt;P&gt;&amp;nbsp; ElseIf edit LineLayer.Name = Map.SelectionLayer.Name Then&lt;/P&gt;&lt;P&gt;' Application.StatusBar.Text = "The edit line layer matches the selection layer"&lt;/P&gt;&lt;P&gt;&amp;nbsp; Call UpdateGPSFields(editLineLayer)&lt;/P&gt;&lt;P&gt;&amp;nbsp; End If&lt;/P&gt;&lt;P&gt;End If&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sub FillGPSForm(editLayer)&lt;/P&gt;&lt;P&gt;' Populates GPS attributes values and the open form&lt;/P&gt;&lt;P&gt;' Use when creating a new feature and the EDITFORM is open &lt;/P&gt;&lt;P&gt;' Testing showed values not updating if attributes are on the active form page, hence the overkill with forms and values&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;' Define variables&lt;/P&gt;&lt;P&gt;Dim f, fCount&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For Each f in editLayer.Forms("EDITFORM").Fields&lt;/P&gt;&lt;P&gt;&amp;nbsp; Select Case Ucase(f.name)&lt;/P&gt;&lt;P&gt;&amp;nbsp; Case "GPS_QUAL"&lt;/P&gt;&lt;P&gt;' Application.StatusBar.Text = GPS.Properties("QUALITY")&lt;/P&gt;&lt;P&gt;&amp;nbsp; f.Value = GPS.Properties("QUALITY")&lt;/P&gt;&lt;P&gt;&amp;nbsp; editLayer.Forms("EDITFORM").Pages.Item("GPS").Controls("txtGPS_QUAL").Value = GPS.Properties("QUALITY")&lt;/P&gt;&lt;P&gt;&amp;nbsp; fCount = fCount + 1&lt;/P&gt;&lt;P&gt;&amp;nbsp; Case "GPS_SATS"&lt;/P&gt;&lt;P&gt;' Application.StatusBar.Text = GPS.Properties("SATS_USED")&lt;/P&gt;&lt;P&gt;&amp;nbsp; f.Value = GPS.Properties("SATS_USED")&lt;/P&gt;&lt;P&gt;&amp;nbsp; editLayer.Forms("EDITFORM").Pages.Item("GPS").Controls("txtGPS_SATS").Value = GPS.Properties("SATS_USED")&lt;/P&gt;&lt;P&gt;&amp;nbsp; fCount = fCount + 1&lt;/P&gt;&lt;P&gt;&amp;nbsp; Case "GPS_X"&lt;/P&gt;&lt;P&gt;&amp;nbsp; f.Value = GPS.x&lt;/P&gt;&lt;P&gt;&amp;nbsp; editLayer.Forms("EDITFORM").Pages.Item("GPS").Controls("txtGPS_X").Value = GPS.x&lt;/P&gt;&lt;P&gt;&amp;nbsp; fCount = fCount + 1&lt;/P&gt;&lt;P&gt;&amp;nbsp; Case "GPS_Y"&lt;/P&gt;&lt;P&gt;&amp;nbsp; f.Value = GPS.y&lt;/P&gt;&lt;P&gt;&amp;nbsp; editLayer.Forms("EDITFORM").Pages.Item("GPS").Controls("txtGPS_Y").Value = GPS.y&lt;/P&gt;&lt;P&gt;&amp;nbsp; fCount = fCount + 1&lt;/P&gt;&lt;P&gt;&amp;nbsp; Case "GPS_Z"&lt;/P&gt;&lt;P&gt;&amp;nbsp; f.Value = GPS.Z&lt;/P&gt;&lt;P&gt;&amp;nbsp; editLayer.Forms("EDITFORM").Pages.Item("GPS").Controls("txtGPS_Z").Value = GPS.Z&lt;/P&gt;&lt;P&gt;&amp;nbsp; fCount = fCount + 1&lt;/P&gt;&lt;P&gt;&amp;nbsp; Case "GPS_LAT"&lt;/P&gt;&lt;P&gt;&amp;nbsp; f.Value = GPS.Latitude&lt;/P&gt;&lt;P&gt;&amp;nbsp; editLayer.Forms("EDITFORM").Pages.Item("GPS").Controls("txtGPS_LAT").Value = GPS.Latitude&lt;/P&gt;&lt;P&gt;&amp;nbsp; fCount = fCount + 1&lt;/P&gt;&lt;P&gt;&amp;nbsp; Case "GPS_LONG"&lt;/P&gt;&lt;P&gt;&amp;nbsp; f.Value = GPS.Longitude&lt;/P&gt;&lt;P&gt;&amp;nbsp; editLayer.Forms("EDITFORM").Pages.Item("GPS").Controls("txtGPS_LONG").Value = GPS.Longitude&lt;/P&gt;&lt;P&gt;&amp;nbsp; fCount = fCount + 1&lt;/P&gt;&lt;P&gt;&amp;nbsp; Case "GPS_ALT"&lt;/P&gt;&lt;P&gt;&amp;nbsp; f.Value = GPS.Altitude&lt;/P&gt;&lt;P&gt;&amp;nbsp; editLayer.Forms("EDITFORM").Pages.Item("GPS").Controls("txtGPS_ALT").Value = GPS.Altitude&lt;/P&gt;&lt;P&gt;&amp;nbsp; fCount = fCount + 1&lt;/P&gt;&lt;P&gt;&amp;nbsp; Case "GPS_PDOP"&lt;/P&gt;&lt;P&gt;&amp;nbsp; f.Value = GPS.Properties("PDOP")&lt;/P&gt;&lt;P&gt;&amp;nbsp; editLayer.Forms("EDITFORM").Pages.Item("GPS").Controls("txtGPS_PDOP").Value = GPS.Properties("PDOP")&lt;/P&gt;&lt;P&gt;&amp;nbsp; fCount = fCount + 1&lt;/P&gt;&lt;P&gt;&amp;nbsp; Case "GPS_HDOP"&lt;/P&gt;&lt;P&gt;&amp;nbsp; f.Value = GPS.Properties("HDOP")&lt;/P&gt;&lt;P&gt;&amp;nbsp; editLayer.Forms("EDITFORM").Pages.Item("GPS").Controls("txtGPS_HDOP").Value = GPS.Properties("HDOP")&lt;/P&gt;&lt;P&gt;&amp;nbsp; fCount = fCount + 1&lt;/P&gt;&lt;P&gt;&amp;nbsp; Case "GPS_VDOP"&lt;/P&gt;&lt;P&gt;&amp;nbsp; f.Value = GPS.Properties("VDOP")&lt;/P&gt;&lt;P&gt;&amp;nbsp; editLayer.Forms("EDITFORM").Pages.Item("GPS").Controls("txtGPS_VDOP").Value = GPS.Properties("VDOP")&lt;/P&gt;&lt;P&gt;&amp;nbsp; fCount = fCount + 1&lt;/P&gt;&lt;P&gt;&amp;nbsp; Case "GPS_DGPS"&lt;/P&gt;&lt;P&gt;&amp;nbsp; f.Value = GPS.Properties("DIFF_ID")&lt;/P&gt;&lt;P&gt;&amp;nbsp; editLayer.Forms("EDITFORM").Pages.Item("GPS").Controls("txtGPS_DGPS").Value = GPS.Properties("DIFF_ID")&lt;/P&gt;&lt;P&gt;&amp;nbsp; fCount = fCount + 1&lt;/P&gt;&lt;P&gt;&amp;nbsp; Case "GPS_DIFF"&lt;/P&gt;&lt;P&gt;&amp;nbsp; f.Value = GPS.Properties("DIFF_AGE")&lt;/P&gt;&lt;P&gt;&amp;nbsp; editLayer.Forms("EDITFORM").Pages.Item("GPS").Controls("txtGPS_DIFF").Value = GPS.Properties("DIFF_AGE")&lt;/P&gt;&lt;P&gt;&amp;nbsp; fCount = fCount + 1&lt;/P&gt;&lt;P&gt;&amp;nbsp; Case "GPS_TIME"&lt;/P&gt;&lt;P&gt;&amp;nbsp; f.Value = FormatDateTime(GPS.Properties&amp;nbsp; ("UTC"), vbLongTime)&lt;/P&gt;&lt;P&gt;&amp;nbsp; editLayer.Forms("EDITFORM").Pages.Item("GPS").Controls("txtGPS_TIME").Value = FormatDateTime(GPS.Properties&amp;nbsp; ("UTC"), vbLongTime)&lt;/P&gt;&lt;P&gt;&amp;nbsp; fCount = fCount + 1&lt;/P&gt;&lt;P&gt;&amp;nbsp; Case "GPS_DATE"&lt;/P&gt;&lt;P&gt;&amp;nbsp; f.Value = FormatDateTime(GPS.Properties&amp;nbsp; ("UTC"), vbShortDate)&lt;/P&gt;&lt;P&gt;&amp;nbsp; editLayer.Forms("EDITFORM").Pages.Item("GPS").Controls("txtGPS_DATE").Value = FormatDateTime(GPS.Properties&amp;nbsp; ("UTC"), vbShortDate)&lt;/P&gt;&lt;P&gt;&amp;nbsp; fCount = fCount + 1&lt;/P&gt;&lt;P&gt;&amp;nbsp; Case "GPS_T_LOC"&lt;/P&gt;&lt;P&gt;&amp;nbsp; f.Value = FormatDateTime(Now, vbLongTime)&lt;/P&gt;&lt;P&gt;&amp;nbsp; editLayer.Forms("EDITFORM").Pages.Item("GPS").Controls("txtGPS_T_LOC").Value = FormatDateTime(Now, vbLongTime)&lt;/P&gt;&lt;P&gt;&amp;nbsp; fCount = fCount + 1&lt;/P&gt;&lt;P&gt;&amp;nbsp; Case "GPS_D_LOC"&lt;/P&gt;&lt;P&gt;&amp;nbsp; f.Value = FormatDateTime(Now, vbShortDate)&lt;/P&gt;&lt;P&gt;&amp;nbsp; editLayer.Forms("EDITFORM").Pages.Item("GPS").Controls("txtGPS_D_LOC").Value = FormatDateTime(Now, vbShortDate)&lt;/P&gt;&lt;P&gt;&amp;nbsp; fCount = fCount + 1&lt;/P&gt;&lt;P&gt;&amp;nbsp; End Select&lt;/P&gt;&lt;P&gt;Next&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sub UpdateGPSFields(selLayer)&lt;/P&gt;&lt;P&gt;' Updates GPS attributes for the selected editable feature&lt;/P&gt;&lt;P&gt;' Use when updating the position of an existing feature with GPS ("move to GPS")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;' Define variables&lt;/P&gt;&lt;P&gt;Dim f, fCount, objRS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;' Get the currently selected record from the edit layer&lt;/P&gt;&lt;P&gt;Set objRS = selLayer.Records&lt;/P&gt;&lt;P&gt;objRS.Bookmark = Map.SelectionBookmark&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For Each f in objRS.Fields&lt;/P&gt;&lt;P&gt;&amp;nbsp; Select Case Ucase(f.name)&lt;/P&gt;&lt;P&gt;&amp;nbsp; Case "GPS_QUAL"&lt;/P&gt;&lt;P&gt;' Application.StatusBar.Text = GPS.Properties("QUALITY")&lt;/P&gt;&lt;P&gt;&amp;nbsp; f.Value = GPS.Properties("QUALITY")&lt;/P&gt;&lt;P&gt;&amp;nbsp; fCount = fCount + 1&lt;/P&gt;&lt;P&gt;&amp;nbsp; Case "GPS_SATS"&lt;/P&gt;&lt;P&gt;' Application.StatusBar.Text = GPS.Properties("SATS_USED")&lt;/P&gt;&lt;P&gt;&amp;nbsp; f.Value = GPS.Properties("SATS_USED")&lt;/P&gt;&lt;P&gt;&amp;nbsp; fCount = fCount + 1&lt;/P&gt;&lt;P&gt;&amp;nbsp; Case "GPS_X"&lt;/P&gt;&lt;P&gt;&amp;nbsp; f.Value = GPS.x&lt;/P&gt;&lt;P&gt;&amp;nbsp; fCount = fCount + 1&lt;/P&gt;&lt;P&gt;&amp;nbsp; Case "GPS_Y"&lt;/P&gt;&lt;P&gt;&amp;nbsp; f.Value = GPS.y&lt;/P&gt;&lt;P&gt;&amp;nbsp; fCount = fCount + 1&lt;/P&gt;&lt;P&gt;&amp;nbsp; Case "GPS_Z"&lt;/P&gt;&lt;P&gt;&amp;nbsp; f.Value = GPS.Z&lt;/P&gt;&lt;P&gt;&amp;nbsp; fCount = fCount + 1&lt;/P&gt;&lt;P&gt;&amp;nbsp; Case "GPS_LAT"&lt;/P&gt;&lt;P&gt;&amp;nbsp; f.Value = GPS.Latitude&lt;/P&gt;&lt;P&gt;&amp;nbsp; fCount = fCount + 1&lt;/P&gt;&lt;P&gt;&amp;nbsp; Case "GPS_LONG"&lt;/P&gt;&lt;P&gt;&amp;nbsp; f.Value = GPS.Longitude&lt;/P&gt;&lt;P&gt;&amp;nbsp; fCount = fCount + 1&lt;/P&gt;&lt;P&gt;&amp;nbsp; Case "GPS_ALT"&lt;/P&gt;&lt;P&gt;&amp;nbsp; f.Value = GPS.Altitude&lt;/P&gt;&lt;P&gt;&amp;nbsp; fCount = fCount + 1&lt;/P&gt;&lt;P&gt;&amp;nbsp; Case "GPS_PDOP"&lt;/P&gt;&lt;P&gt;&amp;nbsp; f.Value = GPS.Properties("PDOP")&lt;/P&gt;&lt;P&gt;&amp;nbsp; fCount = fCount + 1&lt;/P&gt;&lt;P&gt;&amp;nbsp; Case "GPS_HDOP"&lt;/P&gt;&lt;P&gt;&amp;nbsp; f.Value = GPS.Properties("HDOP")&lt;/P&gt;&lt;P&gt;&amp;nbsp; fCount = fCount + 1&lt;/P&gt;&lt;P&gt;&amp;nbsp; Case "GPS_VDOP"&lt;/P&gt;&lt;P&gt;&amp;nbsp; f.Value = GPS.Properties("VDOP")&lt;/P&gt;&lt;P&gt;&amp;nbsp; fCount = fCount + 1&lt;/P&gt;&lt;P&gt;&amp;nbsp; Case "GPS_DGPS"&lt;/P&gt;&lt;P&gt;&amp;nbsp; f.Value = GPS.Properties("DIFF_ID")&lt;/P&gt;&lt;P&gt;&amp;nbsp; fCount = fCount + 1&lt;/P&gt;&lt;P&gt;&amp;nbsp; Case "GPS_DIFF"&lt;/P&gt;&lt;P&gt;&amp;nbsp; f.Value = GPS.Properties("DIFF_AGE")&lt;/P&gt;&lt;P&gt;&amp;nbsp; fCount = fCount + 1&lt;/P&gt;&lt;P&gt;&amp;nbsp; Case "GPS_TIME"&lt;/P&gt;&lt;P&gt;&amp;nbsp; f.Value = FormatDateTime(GPS.Properties&amp;nbsp; ("UTC"), vbLongTime)&lt;/P&gt;&lt;P&gt;&amp;nbsp; fCount = fCount + 1&lt;/P&gt;&lt;P&gt;&amp;nbsp; Case "GPS_DATE"&lt;/P&gt;&lt;P&gt;&amp;nbsp; f.Value = FormatDateTime(GPS.Properties&amp;nbsp; ("UTC"), vbShortDate)&lt;/P&gt;&lt;P&gt;&amp;nbsp; fCount = fCount + 1&lt;/P&gt;&lt;P&gt;&amp;nbsp; Case "GPS_T_LOC"&lt;/P&gt;&lt;P&gt;&amp;nbsp; f.Value = FormatDateTime(Now, vbLongTime)&lt;/P&gt;&lt;P&gt;&amp;nbsp; fCount = fCount + 1&lt;/P&gt;&lt;P&gt;&amp;nbsp; Case "GPS_D_LOC"&lt;/P&gt;&lt;P&gt;&amp;nbsp; f.Value = FormatDateTime(Now, vbShortDate)&lt;/P&gt;&lt;P&gt;&amp;nbsp; fCount = fCount + 1&lt;/P&gt;&lt;P&gt;&amp;nbsp; End Select&lt;/P&gt;&lt;P&gt;Next&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;' Update the record&lt;/P&gt;&lt;P&gt;objRS.Update&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/SCRIPT&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/ArcPad&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 May 2016 14:34:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcpad-questions/script-to-record-gps-metadata/m-p/50161#M375</guid>
      <dc:creator>MarkJohnson</dc:creator>
      <dc:date>2016-05-18T14:34:23Z</dc:date>
    </item>
    <item>
      <title>Re: Script to record GPS metadata?</title>
      <link>https://community.esri.com/t5/arcpad-questions/script-to-record-gps-metadata/m-p/50162#M376</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Mark, since you were able to resolve this yourself, you may want to close this thread by marking it "assumed answered".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I've also attached one of my .vbs files for this project that has many of the functions I use to create and populate shapes on the fly (figuratively and literally, since it is an aerial survey).&amp;nbsp; Reading thru this may give you some additional ideas.&amp;nbsp; I actually have a set of four .vbs that I call from my .apa file (besides the .vbs for my form)&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&amp;lt;/APPLET&amp;gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;SCRIPT src="sessionapps.vbs"/&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;SCRIPT src="transectapps.vbs"/&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;SCRIPT src="bearapps.vbs"/&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;SCRIPT src="createshapes.vbs"/&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/ArcPad&amp;gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I do this so I can easily separate the different functions for the arcpad session, and creating/populating lines vs point functions.&amp;nbsp; I'll attach the createshapes.vbs in case it will help.&amp;nbsp; I renamed it .txt to make it easier to access.&amp;nbsp; Just fyi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 May 2016 15:42:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcpad-questions/script-to-record-gps-metadata/m-p/50162#M376</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2016-05-18T15:42:12Z</dc:date>
    </item>
  </channel>
</rss>

