Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

I have this little app that uses google sheets as its base for the data.  When the app starts, it runs a script that downloads via insert from url a google sheet and stores it in a container field.  it parses it all out into fields etc.  As you can see in the pic, the bottom line in yellow shows the current dance.  done by comparing current time against another table via join.  This value is derived by a InsertOnTimer script that runs every 15 seconds and flushes the join to keep current dance value at the top.  My problem is, when there is a change in the spreadsheet (btw this is the clients choice of storage) I need another timer to run in the background that checks every 15 mins or so and notifies there is an update.  I have the update script working seamlessly..about 10 to 15 seconds for 810 records and 7 fields,  and can do this update manually as well from the preferences screen.  I can't for the life of me get the timer to run to check for updates.  I understand 1 window 1 timer.  I think it would be nice to notify the users of the change in data.  I have tried to used the push notification as well...again works but will not kick because one window one timer.  And I have read that the timers are windows based and not layout based..

So thanks in advance.  it is late here so if clarification is needed just say so.

Dave

FORFORUM.PNG

Two possible solutions come to mind:

1.  Have your OnTimer script do one thing every 15 seconds, and two things every 15 minutes (or every 60th runtime). 

2. Use a web viewer for showing the current dance (will require some Javascript work).

  • Author

Ok thanks.  I believe the later of the two is beyond my skill level or at least i have not ever used java in filemaker or java at all for that matter.  the first I believe you are telling me to do a loop and then on the 60th run them both.  So my understanding is, you are saying I can run two timers in one script but not two independent timers in one window. Correct?  And could i not open a second window, move it to the background and run the update script.

Dave

2 hours ago, tbcomputerguy said:

I believe you are telling me to do a loop and then on the 60th run them both

It's not exactly a loop. I meant keep a counter in a global field or variable, and when the counter gets to 60, do the other thing and reset the counter - something like (pseudocode, untested):

Perform Script [ "Script A" ]
Set Variable [ $$OnTimerCounter ; Valus: $$OnTimerCounter + 1 ]
If [ $$OnTimerCounter = 60 ]
  Perform Script [ "Script B" ]
  Set Variable [ $$OnTimerCounter ; 0 ]
End If
Install OnTimer Script ["This Script"; Interval: 15]

 

--
P.S.. Javascript is not Java. Two completely different things. And using Javascript in a web viewer is often convenient, esp. for tasks like this that involve a "live" ticking clock - see, for example:
https://fmforums.com/topic/71934-calculating-elapsed-time-realtime/?do=findComment&comment=340205

image.png.3276add294b65a553b9bbade6f23768d.png

From: https://www.smashingmagazine.com/2009/07/misunderstanding-markup-xhtml-2-comic-strip/

 

 

Edited by comment

  • Author

Sorry I mean javascript. Cute cartoon and the eggtimer file is quiet cool...i think that might come in handy.  I will have a go at this.  Sorry I had to edit this..just thought of something.  Would this be implemented with a script trigger attached to a layout or just attached to a button from the nave screen.

Thanks again

Dave

Edited by tbcomputerguy

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.