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.

CheckWhetherFileExists problem

Featured Replies

  • Newbies

I register ScriptMaster's CheckWhetherFileExists in my solution's startup script this way:

If [

RegisterGroovy( "CheckWhetherFileExists( pathToFile )" ; "new File( pathToFile ).exists()" ) = "ERROR"

]

do a Custom Dialog that tells the user to contact me about an error loading ScriptMaster.

I never see an error this way. However, not infrequently, when the file I want to detect indeed exists in the proper subfolder where the solution is running, CheckWhetherFileExists fails to see it. I find the only way to get it to work in such a situation is to exit and restart Filemaker and my solution. Even exiting my solution isn't enough. The line that fails to see the file is a simple If Statement:

If [CheckWhetherFileExists( "Old/WAT_Data.WAT" ) = 0]

Custom Dialog telling the user the import cannot be run, and then Exit Script.

Is this a known problem with ScripMaster 3.1?

From what I've been able to test, this function needs an absolute file path rather than a relative one, though I could be wrong about syntax. Have you been using this with a relative path?

This problem has been sent to Filemaker Support. They performed their own test and see this as an issue. The error capture function is not performing as it should. Thanks for the input.

  • Author
  • Newbies

Using a relative path works, but is not consistent.

  • Author
  • Newbies

I now find that if I calculate the absolute path, it seems to work fine. If I use a relative path, it's inconsistent. I'm using this to get the folder for the solution file:

Let ( [ x = Substitute ( Get (FilePath ) ; "file:/" ; "" ) ] ;

Left ( x ; Position ( x ; "/" ; Length ( x ) ; -1 ) - 1 )

)

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.