Newbies ralvy Posted October 15, 2009 Newbies Posted October 15, 2009 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?
Smef Posted October 15, 2009 Posted October 15, 2009 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?
Real Posted October 15, 2009 Posted October 15, 2009 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 ralvy Posted October 15, 2009 Author Newbies Posted October 15, 2009 Using a relative path works, but is not consistent.
Newbies ralvy Posted October 23, 2009 Author Newbies Posted October 23, 2009 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 ) )
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now