Skip 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.

Script in background

Featured Replies

Is it possible to run a script in the background? Like constantly looping waiting for an event to occur?

What kind of event?

  • Author

A file showing up in a folder.

I tried taking my KICKER script and incorporating it into the CHART file but since it loops constantly waiting for a file to show up in the folder, it locks everything else up.

I don't know how FMP can tell if a file exists in a folder, but the general principle would be:

Loop

Exit Loop If [file exists]

End Loop

This scrip will loop around at an enormous, CPU-hogging speed so it might be wise to put a pause in there...

Loop

Exit Loop If [file exists]

Pause/Resume Script [1 sec]

End Loop

Do you know that FMP is single threaded? While this script it looping aound you won't be able to do anything else in FMP, even in another database.

  • Author

That was what I figured. So I have to either put long pauses in the script or keep it away from the main application.

Oh, and the way it works for the file is to attempt to IMPORT the file. If there is an error it starts over otherwise it sends control to another script.

You could probably do this with applescript or winbatch depending on your platform.

  • Author

I am trying to do an interface with winbatch and Cold Fusion. I will let CF detect the incoming file and then have it call a bat file that starts a FM script that calls the export scritp. whew. The only reason I am going that meandering route is because I want it all on the same machine. And I can't get the FM script to actually call the external script for some reason when it is on FMS. It works great when everything is in FMP but I put the main app back onto FMS and it stops working.

Are you running FMP on the FM Server? The server does nothing more than manage the databases. You need to be running a client on a separate machine to interface with the dbs. This could explain some of your problems that have been incomprehensible to us thus far.

  • Author

No, I have a small exe app that opens the DBs as guests on the client machines. That works fine for the most part.

I still can't get another client app to execute an external script on the FMS app tho. That is all part of this.

I see the biggest part of getting FM down is understanding how the db/files communicate and work together.

Like each client opening the dbs as guests. Now these guest dbs must communicate with the main db otherwise data would be corrupted left and right. This dawned on me during the discussion about session management. Each client is given a "marker" when it opens up and that is kept on the client and passed to the server db whenever anything is done. The server keeps track of what each client is doing in this way.

Nobody could explain that, so I had to figure it out on my own. smile.gif

What type of exe app and what is it doing?

Again, no scripts run on the server; they are client-based. Therefore any exe's running should be client-based.

  • Author

The exe was created by the FM3.0 SDK.

It is all messed up but the people paying my salary don't want me to fix it since "everyone is used to it" after 5 years.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.