May 1, 201114 yr What does ScriptMaster do with console messages? Like the one produced by this: System.out.print("Hello World") Is there any way to capture that output? I want to use some open source code that has many calls to System.out.print, so just not using that statement isn't an option in this scenario.
May 2, 201114 yr That is just a "print" message. The output from that statement is "Hello World." If you want to capture and use what is being written you should handle it from within your class and present it to users through some other means such as a dialog box rather than passing it to a System.out.print(). The log messages appear in either the java console, apple console, terminal, or the command prompt window if you execute your program from terminal/command prompt. You should not use this command to present information to your users.
May 2, 201114 yr Author What I was trying to find out is if there is any way to redirect what is sent to System.out.* so that I can use it in a manner that works in the ScripMaster plug-in environment. I don't use that statement in my plug-in code, but I'm trying to utilize someone else's code that does.
May 2, 201114 yr You can return it as a result of your scriptmaster module and then display it in a filemaker text field or create a dialog box through java code that displays the message.
May 3, 201114 yr Dan If you do println "something" in Groovy that is the same thing It means you can test things out using the Groovy console to check results etc... Depends why it is there in the code in the first place If you create a variable than you can collect errors along the way then do If ( var != "") { return var } else { return true } which will give you the output to the result of the Groovy Script so in FM $result = SomeSmFunction(params) If $result <> "1" then display it in a FM dialogue box Also http://stackoverflow.com/questions/121665/how-to-pipe-stdout-from-a-groovy-method-into-a-string
August 27, 201312 yr That is just a "print" message. The output from that statement is "Hello World." If you want to capture and use what is being written you should handle it from within your class and present it to users through some other means such as a dialog box rather than passing it to a System.out.print(). The log messages appear in either the java console, apple console, terminal, or the command prompt window if you execute your program from terminal/command prompt. You should not use this command to present information to your users. No, really: how does one get just a "print" message to work from a ScriptMaster script? Would like to use it for debugging. Returning as a result is impractical. Can you be more specific about where FMP-Client ScriptMaster log messages appear (under what circumstances), and, specifically, how to redirect them to, say, a log file easily visible in the Console.app? TIA...
Create an account or sign in to comment