October 15, 200916 yr 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?
October 15, 200916 yr 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?
October 15, 200916 yr 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.
October 23, 200916 yr 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