December 12, 201114 yr Is there any way to get a list of the functions in a Scriptmaster plug-in into Filemaker so I can see if a specific function is available to use? I realise that I could call the function to see if it returns an error, but in this case it is the ChooseFile function and I don't want to confuse the user by putting up a dialog box for no obvious reason if that function is present Thanks Brian
December 12, 201114 yr Brian, Are you wanting to view the functions available yourself during development? You can see that in a calculation dialog under "external functions." Everything should be listed there under the name of the plugin you created. Any user with the plugin installed and registered would have access to those functions in the solution file.
December 13, 201114 yr Author No, that's not the issue. I'd like to be able to determine though a script whether a function is available in a plug in or not. I can't call the function to see if it is present because in this case it would cause a dialog to open, confusing the user. Brian
December 13, 201114 yr Are you creating a plugin using ScriptMaster with the Choose File module included?
December 13, 201114 yr When you register the function in the solution with RegisterGroovy, you can check for it to return "ERROR". Something like this: If [RegisterGroovy( "ChooseFile( startingPath; prompt )" = "ERROR"] Show Custom Dialog ["Could not register function"; SMLastError] End If Of course you could handle the error by simply not using the function instead of showing a dialog to the user. Hope this helps. The other thing I should mention is that the plugin will return '?' if it is not installed so you should do error checking/handling for that as well. You could also run auto-update to make sure that the client installs it.
Create an account or sign in to comment