jasonwood Posted June 25, 2012 Posted June 25, 2012 I have a script that sends bulk emails using ScriptMaster. It runs fine as a scheduled script from the server, but I can't get it working when run through custom web publishing (php). Screen shot of the script is attached. Basically I want to run it from a button instead of as a scheduled script every 5 minutes clogging up resources & log files, so I created a php script that runs the script, and attached a button to the php page using "Go to URL". I know the script is running because it is writing the error (see script). The following debug calculation: "ERROR " & SMLastError & " Registered Modules: " & SMGetRegisteredModules & " $register variable: " & $register returns: ERROR ? Registered Modules: ? $register variable: ? Why would the same script work as a server scheduled script but not through custom web publishing? The script runs as full access so the only issue there should be with permissions is having access to the script itself, and we know the script is running due to the error writing. sendBulkEmailScript.tiff
David Wikström Posted June 25, 2012 Posted June 25, 2012 I'm not sure this is the main issue, but the first thing that strikes me from the screen shot is that your test for the function "SendEmailWithAuthentication" being registered, but the function that you then register and use is called "SendEmailWithHtmlAndReturnPath". For this kind of use, it might be easier to get a ScriptMaster Advanced license and compile a custom plugin - I always find that it's nice to have one less thing to think about in my scripts. (OFF-TOPIC: I was really glad to see that Crumpler Canada is running FileMaker when I was in the Vancouver store a few months ago - I'm a big fan of Crumpler! The layouts looked nice, as they should for a brand like yours.)
jasonwood Posted June 26, 2012 Author Posted June 26, 2012 Good catch, but unfortunately, it's not the problem. SMGetRegisteredModules is only returning "?" anyway, which tells me that the server doesn't see the plug-in. Yet it works when you run it as a schedule... this is driving me crazy!!
David Wikström Posted June 26, 2012 Posted June 26, 2012 And you've installed the plugin in the right place for web publishing? http://360works.com/plugins/SCRIPTMASTERPLUGIN/documentation.html#install
jasonwood Posted June 27, 2012 Author Posted June 27, 2012 I just knew it would be something stupid!;-) Thanks.
jasonwood Posted June 29, 2012 Author Posted June 29, 2012 Still can't get it going. To try to narrow it down, at the top of my script I set the variable $version to SMVersion, and later output that to a field. The result is always "?" (to that and every other call to a ScriptMaster function). Also, nothing comes up if I output Get ( InstalledFMPlugins ). I found the login file "360Plugins_WebPublishing.log" in Library/FileMaker Server/Logs/360Plugin Logs It seems to show that the plugin is being loaded just fine: (C++ Thu Jun 28 22:30:18 2012) INIT - Creating new log file (C++ Thu Jun 28 22:30:18 2012) *** INIT for 360Works ScriptMaster_WebPublishing at Thu Jun 28 22:30:18 2012, headless mode 1, appTypeShort 8 (C++ Thu Jun 28 22:30:18 2012) No existing JVM found; creating one. (C++ Thu Jun 28 22:30:18 2012) Running in headless mode; starting JVM on main thread (C++ Thu Jun 28 22:30:18 2012) Enabling headless mode (C++ Thu Jun 28 22:30:18 2012) Java home dir was dynamically read: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home (C++ Thu Jun 28 22:30:18 2012) 0: -Djava.awt.headless=true (C++ Thu Jun 28 22:30:18 2012) 1: -Djava.class.path=noclasspath (C++ Thu Jun 28 22:30:18 2012) 2: -Xbootclasspath/a:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../Resources/JavaPluginCocoa.bundle/Contents/Resources/Java/deploy.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../Resources/JavaPluginCocoa.bundle/Contents/Resources/Java/plugin.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/deploy.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/plugin.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/jaws.jar (C++ Thu Jun 28 22:30:18 2012) 3: -Djava.ext.dirs=/System/Library/Java/Extensions:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/ext:/Library/Java/Extensions (C++ Thu Jun 28 22:30:18 2012) 4: -Dcom.apple.eawt.CocoaComponent.CompatibilityMode=false (C++ Thu Jun 28 22:30:18 2012) JVM started successfully - jvm references is 220702376 (C++ Thu Jun 28 22:30:18 2012) Call finished (C++ Thu Jun 28 22:30:18 2012) fmkitUrl: file:///Library/FileMaker%20Server/Web%20Publishing/publishing-engine/wpc/Plugins/360Works_ScriptMaster.fmplugin/Contents/Resources/Java/plugin.jar Jun 28, 2012 10:30:18 PM com.prosc.fmkit.PluginBridge initLogging CONFIG: Will write normal log file to /Library/FileMaker Server/Logs/360Plugin Logs/360Plugins_WebPublishing.log Jun 28, 2012 10:30:18 PM com.prosc.fmkit.PluginBridge initMac CONFIG: Loading dynamic library at /Library/FileMaker Server/Web Publishing/publishing-engine/wpc/Plugins/360Works_ScriptMaster.fmplugin/Contents/MacOS/JaCK3 Jun 28, 2012 10:30:19 PM com.prosc.fmkit.PluginBridge initMac CONFIG: Loading plugin jar at /Library/FileMaker Server/Web Publishing/publishing-engine/wpc/Plugins/360Works_ScriptMaster.fmplugin/Contents/Resources/Java/plugin.jar Jun 28, 2012 10:30:19 PM com.prosc.fmkit.PluginBridge getPluginClassNameForPluginJar CONFIG: Loading Plugin class named com.prosc.beanshell.BeanShellPlugin Jun 28, 2012 10:30:19 PM com.prosc.fmkit.PluginBridge <init> INFO: 360Works custom SecurityManager has been installed Jun 28, 2012 10:30:19 PM com.prosc.fmkit.PluginBridge loadVersion8Lib CONFIG: Loading the version 8 library from /Library/FileMaker Server/Web Publishing/publishing-engine/wpc/Plugins/360Works_ScriptMaster.fmplugin/Contents/MacOS/version8lib.jnilib Jun 28, 2012 10:30:19 PM com.prosc.fmkit.PluginBridge loadVersion8Lib CONFIG: Version 8 lib was loaded successfully Jun 28, 2012 10:30:19 PM com.prosc.fmkit.PluginBridge fmxInit INFO: Creating shared PluginBridge instance / plugin bridge version 1.64 bundlePath: /Library/FileMaker Server/Web Publishing/publishing-engine/wpc/Plugins/360Works_ScriptMaster.fmplugin/Contents/Resources jvm version: 20.6-b01-415 from /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home - JAVA_JVM_VERSION is /System/Library/Frameworks/JavaVM.framework/Versions/1.6/ Operating system info: Mac OS X 10.7.3 running on i386 architecture Temp directory: /var/folders/0d/0jlddp6j5375ck4qm9561pjm0000gp/T/ Jun 28, 2012 10:30:19 PM com.prosc.fmkit.PluginBridge fmxInit CONFIG: Initialize 360Works ScriptMaster Jun 28, 2012 10:30:19 PM com.prosc.fmkit.Plugin init CONFIG: Created new plugin instance: com.prosc.beanshell.BeanShellPlugin named 360Works ScriptMaster; version: 4.132 Jun 28, 2012 10:30:19 PM com.prosc.license.client.Registration checkLicense INFO: Registered successfully with demo license; will run for two hours after launch. Jun 28, 2012 10:30:19 PM com.prosc.license.client.Registration checkLicense INFO: Expiration date Fri Jun 29 00:30:19 EDT 2012 Jun 28, 2012 10:30:19 PM com.prosc.beanshell.BeanShellPlugin init INFO: Registered with hard-coded license key Jun 28, 2012 10:30:19 PM com.prosc.beanshell.BeanShellPlugin customizeFunction INFO: Function PluginFunction{name='EvaluateGroovy', functionID=28121, minArgs=null, maxArgs=1} runs in swing Jun 28, 2012 10:30:19 PM com.prosc.fmkit.PluginBridge registerFunction INFO: PluginBridge{instanceID=47718560} registering PluginFunction{name='EvaluateGroovy', functionID=28121, minArgs=null, maxArgs=1} Jun 28, 2012 10:30:19 PM com.prosc.fmkit.PluginBridge registerFunction INFO: PluginBridge{instanceID=47718560} registering PluginFunction{name='SMSetVariable', functionID=-3516, minArgs=null, maxArgs=2} Jun 28, 2012 10:30:19 PM com.prosc.fmkit.PluginBridge registerFunction INFO: PluginBridge{instanceID=47718560} registering PluginFunction{name='SMGetVariable', functionID=-28360, minArgs=null, maxArgs=1} Jun 28, 2012 10:30:19 PM com.prosc.fmkit.PluginBridge registerFunction INFO: PluginBridge{instanceID=47718560} registering PluginFunction{name='SMVersion', functionID=-12574, minArgs=null, maxArgs=0} Jun 28, 2012 10:30:19 PM com.prosc.fmkit.PluginBridge registerFunction INFO: PluginBridge{instanceID=47718560} registering PluginFunction{name='SMLastError', functionID=26664, minArgs=null, maxArgs=0} Jun 28, 2012 10:30:19 PM com.prosc.fmkit.PluginBridge registerFunction INFO: PluginBridge{instanceID=47718560} registering PluginFunction{name='SMLastStackTrace', functionID=-4147, minArgs=null, maxArgs=0} Jun 28, 2012 10:30:19 PM com.prosc.fmkit.PluginBridge registerFunction INFO: PluginBridge{instanceID=47718560} registering PluginFunction{name='SMLoadJar', functionID=-32667, minArgs=null, maxArgs=1} Jun 28, 2012 10:30:19 PM com.prosc.fmkit.PluginBridge registerFunction INFO: PluginBridge{instanceID=47718560} registering PluginFunction{name='SMReset', functionID=29931, minArgs=null, maxArgs=0} Jun 28, 2012 10:30:19 PM com.prosc.fmkit.PluginBridge registerFunction INFO: PluginBridge{instanceID=47718560} registering PluginFunction{name='RegisterGroovy', functionID=6991, minArgs=2, maxArgs=-1} Jun 28, 2012 10:30:19 PM com.prosc.fmkit.PluginBridge registerFunction INFO: PluginBridge{instanceID=47718560} registering PluginFunction{name='SMGetRegisteredModules', functionID=-16535, minArgs=null, maxArgs=0} Jun 28, 2012 10:30:19 PM com.prosc.fmkit.PluginBridge registerFunction INFO: PluginBridge{instanceID=47718560} registering PluginFunction{name='SMGetLoadedJars', functionID=-15591, minArgs=null, maxArgs=0} Jun 28, 2012 10:30:19 PM com.prosc.fmkit.PluginBridge registerFunction INFO: PluginBridge{instanceID=47718560} registering PluginFunction{name='SMCreatePlugin', functionID=-2359, minArgs=null, maxArgs=7} Jun 28, 2012 10:30:19 PM com.prosc.fmkit.PluginBridge fmxInit CONFIG: Return VERSION_CURRENT: 51 (C++ Thu Jun 28 22:30:19 2012) *** INIT finished with result 51 What could I be missing here?
wbasham Posted June 29, 2012 Posted June 29, 2012 Can you tell me which version of FileMaker Server you are using so we can try to reproduce this locally?
Recommended Posts
This topic is 4598 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