Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 4117 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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.

Posted

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.

Posted

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.

Posted

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.

Posted

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

  • 2 years later...
Posted

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...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.