john renfrew Posted May 10, 2017 Posted May 10, 2017 (edited) in the older version the function would be RegisterGroovy( "SMisLoaded" ; "return true; isGui=false" ) now it is RegisterGroovy( "SMisLoaded" ; "return true"; "isGui=false" ) therefore ALL functions written with previous version fails ANY SUGGESTIONS?? Edited May 10, 2017 by john renfrew
Michael Gaslowitz Posted May 11, 2017 Posted May 11, 2017 John, The main issue is that the RegisterGroovy function in ScriptMaster v5 isn't treating the third parameter optionally, even though it's inside curly braces: ## ScriptMaster v5 ## RegisterGroovy( signature ; script {; isGui ; key1=value2 ; ... } ) ## omitting third parameter in RegisterGroovy function returns ## "java.lang.ArrayIndexOutOfBoundsException: 0" instead of 1 Let ( ~result = RegisterGroovy( "SMisLoaded" ; "return true;" ) ; Case ( ~result = "ERROR" ; SMLastError ; ~result ) ) The secondary issue is that the RegisterGroovy function in ScriptMaster v4 looked for “isGui=false” an optional “key=value” pair. I don’t think including it at the end of the groovy script actually did anything, especially after "return true" processed. ## ScriptMaster v4 ## RegisterGroovy( signature; script{; key1=value1; key2=value2; …} ) ## best practice if you don't need a GUI RegisterGroovy( "SMisLoaded" ; "return true;" ; "isGui=false" ) ; ## not wrong, just doesn't affect the GUI RegisterGroovy( "SMisLoaded" ; "return true; isGui=false" ) ; We'll let you know when we have an update. Michael
john renfrew Posted May 11, 2017 Author Posted May 11, 2017 Thanks Michael My version of the file that I have been developing in for quite are years with the plugin gives "return true; isGui=false" We need a way for 16 and pre 16 to exist in the same environment, and I am not sure I like the idea of adjusting all my scrip steps, as you know i am a heavy user of the plugin.. john
Michael Gaslowitz Posted May 11, 2017 Posted May 11, 2017 John, Again, there's a bug in ScriptMaster v5 which is causing an error if the third parameter is empty. Once that is fixed your functions should resume working as they have before. However, adding "isGui=false" to the end of your script (as the second parameter) doesn't do anything except make your function run a little slower than if you were to leave it out completely: ## how "isGui=false" is passed to RegisterGroovy RegisterGroovy ( "Test1" ; "return true;" ) RegisterGroovy ( "Test2" ; "return true; isGui=false" ) ## your script RegisterGroovy ( "Test3" ; "return true;" ; "isGui=true" ) RegisterGroovy ( "Test4" ; "return true;" ; "isGui=false" ) ## recommended ## Total time is takes to call each registered function 1000 times: Test1: 4588 ms Test2: 4864 ms ## your script Test3: 5223 ms Test4: 93 ms ## recommended You can test this with ScriptMaster v4 for now: http://s3-external-1.amazonaws.com/com.prosc.support.uploads/Outbound/ScriptMasterGuiTest.fmp12.zip?AWSAccessKeyId=AKIAIDQUCQL7APZLJCDA&Expires=1497109423&Signature=f7C5P0zEz193czErKG83a8VRNhM%3D Michael
john renfrew Posted May 11, 2017 Author Posted May 11, 2017 Thanks for the prompt attention The 5.02 version on the site seems to work as I expected, will look at amending the script steps as required.. Are you sure?? here's my results
john renfrew Posted May 11, 2017 Author Posted May 11, 2017 (edited) OK, to clarify that was 5.02 on 16 THIS is 4.42 on 15 And. Sorry, I mis-spoke as they say the script couldn't see the functions this is 5.02 in 16 Edited May 11, 2017 by john renfrew
Michael Gaslowitz Posted May 11, 2017 Posted May 11, 2017 The functions aren't actually getting registered with ScriptMaster v5. Always test for errors kids. http://s3-external-1.amazonaws.com/com.prosc.support.uploads/Outbound/ScriptMasterGuiTest.fmp12.zip?AWSAccessKeyId=AKIAIDQUCQL7APZLJCDA&Expires=1497112821&Signature=O%2B%2B3nWn%2BmTE6N6GkZh5YICZN2KM%3D
Recommended Posts
This topic is 2820 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