Canucks Posted January 11, 2006 Posted January 11, 2006 (edited) 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, 2006 by Guest
sbg2 Posted January 12, 2006 Posted January 12, 2006 "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]
Recommended Posts
This topic is 6893 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now