January 11, 200620 yr I've made a script to export a file every 30th seconds of the minute base upon Status field. If there's a new record added, the status will mark as "NO". If the new record/records are exported, it the status will mark as "YES". There's a trick to this inorder the script to work is that I must have a dummy record that always says "NO" because if the script found nothing it will pause and say no record found. Here is how the script goes, Loop Show All Records If[seconds(Get(CurrenTime)))=30] Perform Script ["Enter Find Mode"] {which looks for records with the "NO" status } If[Get(FoundCount) > 1] Perform Script["Export Download"] {which export the new records to a text file for other apps to use } End If Perform Script["Replace Found"] {replace the records status "NO" to "YES" } Perform Script["Dummy Record"] {set the dummy record from "Yes" status to "No" status } End If Allow User Abort[On] End Loop My question is how can i get it to check every 30 seconds instead of the seconds reaches 30 to execute the script. Edited January 11, 200620 yr by Guest
January 12, 200620 yr "There's a trick to this inorder the script to work is that I must have a dummy record that always says "NO" because if the script found nothing it will pause and say no record found." Look up the Set Error Capture script step to stop an error message from being triggered. "My question is how can i get it to check every 30 seconds instead of the seconds reaches 30 to execute the script" I would create two new global fields: g_CheckTime1 and g_CheckTime2 set these when the script is started (Before you start looping!) g_CheckTime2 = Seconds(Get(CurrenTime))) g_Checktime1 = If(g_CheckTime2 < 31; g_CheckTime2 + 30; (g_CheckTime2 + 30)- 60) then in replace of If[seconds(Get(CurrenTime)))=30] you have: If[seconds(Get(CurrenTime)))= g_CheckTime1 or Seconds(Get(CurrenTime)))= g_CheckTime2]
Create an account or sign in to comment