Lape Posted November 10, 2011 Posted November 10, 2011 Hello, Denmark calling! I think i´m in love with ScriptMaster - but i´m struggeling to get started.... maybe i´ll just explain: I have developed a medium sized trucking/transport solution and have been running it for apx. 2 years now and the only real problem i have had, is sending Email from the server. We have a Windows 2003 + FMS10 Adv. server with IWP running the online booking and a scheduled mailqueue to send mail though a local mailserver every 3 minutes.... It....kind of works....(all attachment to the server-side-sent mail is getting corrupted - known bug in FMS as i understand it) - so i have tested your wonderfull ScriptMaster plugin (locally) and it simply shines and i´ll LOVE to implement it our solution....and here comes the 'but': I simply cant find the information to get ScriptMaster to work from the SERVER - my bad im sure, but I KNOW that i have colleagues in other firms that would love to get this info also.... so here goes: Focusing on the Email-function - running on/from the FM Server Adv - the ScriptMaster module is installed and reported no errors, so : 1. Do i need to install SM on BOTH the server AND all the clients, if i´m ONLY going to use the scripted/scheduled Email on the server ? 2. How do I register the SM-module on the server - i´v tried to register the functions and then upload ScriptMaster.fp7 and run it from the server to no avail...(Cannot use "open" function in a server script) Even if I run SM remote off the server it cannot see 'it self'... 3. The documentation says that i can paste the key into a variable to get it running on the server - but i dont have key....yet...whats up here ?? 4. I have no problem buying a license to the SM Advanced version and then building my own plugin - but I would like to see it work before forking out I should be able to send Email by using the standard free SM-plugin on the server, right ? 5. Finally I figured out that I can CLICK on the long list of modules and get documentation on the SM functions....For dummies like me, i need an underlining in blue to get the fact that i can click Any help with the above is VERY much appreciated, thank you in advance ! Lars G. Pedersen
bcooney Posted November 11, 2011 Posted November 11, 2011 I'll try to help: 1. No. 2. I have SM register in an Open script that the server runs. 3. Basically, you can copy what you need out of the ScriptMaster file into your file. This is done by clicking the Register Function button at the bottom of the module form. Then, following the directions to Paste into your solution. So, in a startup script that is run by the server, you'd have: Set Variable [$sm.createFolder; RegisterGroovy( "CreateFolder( pathToCreate )" ; "//Really simple version:¶ //return new File(path).mkdirs();¶ ¶ //Version with decent error reporting:¶ File dir = new File(pathToCreate);¶ if( dir.exists() ) return false;¶ if( dir.mkdirs() ) { //Success!¶ return true;¶ } else { //Figure out why it failed¶ File realParent = dir;¶ while( realParent != null && ! realParent.exists() ) {¶ realParent = realParent.getParentFile();¶ }¶ if( realParent != null && !realParent.canWrite() ) {¶ throw new FileNotFoundException(\"Directory \" + dir.getAbsolutePath() + \" could not be created because the parent directory \" + realParent.getAbsolutePath() + \" is not writeable\" );¶ } else {¶ throw new FileNotFoundException(\"Directory + \" + dir.getAbsolutePath() + \" could not be created because of an unknown error.\" );¶ }¶ }" )
Lape Posted November 12, 2011 Author Posted November 12, 2011 bcooney - THANKS - i´ll try as you described - strange it has to be so hard when SM itself is so fine...
andries Posted November 14, 2011 Posted November 14, 2011 I actually don't agree it is the power of ScriptMaster to be so modular. You can create any kind of module / plugin function with ScriptMaster, because they use this architecture. They just provide a bridge between Groovy and Filemaker, it is up to the developers to develop the code in Groovy, and register that code via ScriptMaster so it can be used in FileMaker. In comparison with other modular plugins (SmartPill for example) we have at least the ability to register Groovy code as a FileMaker function, so we shouldn't use the complete Groovy code all the time. When using SmartPill you always should use the "EvaluateGroovy" equivalent, which makes your scripts/calculations really unreadable.
bcooney Posted November 14, 2011 Posted November 14, 2011 I think that the ScriptMaster file's interface is confusing. I had to click around a lot to discover the Register Function and to understand that was the ticket to bringing the module into my solution.
Recommended Posts
This topic is 4775 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