brian rich Posted December 12, 2011 Posted December 12, 2011 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
wbasham Posted December 12, 2011 Posted December 12, 2011 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.
brian rich Posted December 13, 2011 Author Posted December 13, 2011 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
wbasham Posted December 13, 2011 Posted December 13, 2011 Are you creating a plugin using ScriptMaster with the Choose File module included?
wbasham Posted December 13, 2011 Posted December 13, 2011 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.
Recommended Posts
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