dansmith65 Posted May 1, 2011 Posted May 1, 2011 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.
Smef Posted May 2, 2011 Posted May 2, 2011 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.
dansmith65 Posted May 2, 2011 Author Posted May 2, 2011 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.
Smef Posted May 2, 2011 Posted May 2, 2011 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.
john renfrew Posted May 3, 2011 Posted May 3, 2011 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
Larry Goldman Posted August 27, 2013 Posted August 27, 2013 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...
Recommended Posts
This topic is 4117 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