Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 5521 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

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?

Posted

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?

Posted

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.

  • Newbies
Posted

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 )

)

This topic is 5521 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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