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.

timing of script commands

Featured Replies

Hello,

a script runs the "send event" the dos-command xcopy ("cmd /c xcopy .....").

When xcopy has finished the next script-command should start (import files).

Because the time xcopy needs differs from 1 to 100 seconds, a delay is not nice.

I hope you can give me some advice for a better solution.

thx

Set Error Capture[On]

Sent Event[]

Loop

Import File['your file here']

Exit Loop If[Get(LastError) = 0 or $time=120]

Pause / Resume Script[1]

Set Variable[$time ; $time + 1]

End Loop

If[$time = 120]

Show Custom Dialog[import failed]

Else

Show Custom Dialog[import Successful]

End If

You could also use the shell plugin from abstrakt.com. Then the import script step could be right after the send event, and it wouldn't proceed until thte xcopy was finished.

Or you could have your xcopy run inside a batch file which calls a vbscript when it's finished. The vbscript would trigger a scriptmaker script that did the import.

  • Author

a) I can't see, how shell-plugin can do waiting for xcopy.. which shell-command can perform this?

:( yes, I know. but vb should not be installed on the system. is it also possible with vba? (because I think, vba are implemented in xp)

maybe you have a concrete idea of this command :-)), because its my first contact with vb or vba.

:( yes, I know. but vb should not be installed on the system

VBScript - VBS i.e. a text file with a .vbs extension - the engine comes installed on every XP PC.

  • Author

yes, I have it :(

but, now, how can I start a script in filemaker (it is open) with vbs? which commands and so on?

example: in the file fm-batch.bat are two lines:

"xopy ......... "

"rem if xcopy finished, than script"

"start_script.vbs"

and which vbs-lines must be in the file start_script.vbs?

  • Author

Set Error Capture[On]

Sent Event[]

Loop

Import File['your file here']

Exit Loop If[Get(LastError) = 0 or $time=120]

Pause / Resume Script[1]

Set Variable[$time ; $time + 1]

End Loop

If[$time = 120]

Show Custom Dialog[import failed]

Else

Show Custom Dialog[import Successful]

End If

thanks very much for full code. but I am not shure

if it solves my problem, because after line 2 "sent event" comes immediatly "import". or maybe I interpret the loop... in a wrong way.

please could you spend a few words on it? :(

Edited by Guest

Essentially...

You send your event to do whatever it has to do - from your explanation i understand that eventually when it's finished doing what it has to do, FileMaker is to import the resulting file...

So all the loop does is goes in circles trying to import the resulting file -- if the file doesn't yet exist, it throws an error after Import File[] -- so we wait one second and try again.

The loop iterates 120 times in 1 second intervals and will exit either when it's gone through the full 120 cycles with no result... or If it manages to import the file.

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.