@hansjoerg.watzi
Ah, but actually you can make the \\n work in the script. You just have to know how to get the script to recognize it. See the following test script below for how to make it work:
#!/bin/sh
jhPath="/Library/Application Support/JAMF/bin/jamfHelper.app/Contents/MacOS/jamfHelper"
Desc="$4"
MSG=$( echo "$Desc" )
sudo "$jhPath" -windowType utility -title "My Title" -description "$MSG" -button1 "OK" -defaultButton 1
The trick above is to use 'echo' to set up a new variable from the one passed in the parameter. This works because echo will recognize the newline character, \\n, and translate it into actual line breaks as it sets up the final message variable to pass into jamfHelper. I haven't tested it, but I think using printf may also do the trick here.
I just ran this through a quick test and setting up $4 with the line:
"This is the first line of the message.\\
This is the second line in the message.\\
This is the third line in the message."
Actually gave me something like this in the jamfHelper window-
This is the first line of the message.
This is the second line in the message.
This is the third line in the message.
I can even do this in the message to get a blank line between:
This is line 1.\\
\\
This is line 2.
Result:
**This is line 1.
This is line 2.**
Give it a try. It seems to work for me.
The cool thing about this is its pretty flexible because if your message doesn't have any line break characters in it, it doesn't matter. It also doesn't matter how many lines you need. You can add as many as you like in one parameter, and it also doesn't use more than one parameter in the policy.
As for getting html messages with formatting and background images, etc, sorry, can't help you there ; )
Edit: Quick additional note. The command 'sudo jamf runScript -script "ScriptName.sh" -path, etc seems to handle line breaks and other escaped stuff differently than when passing a parameter to a script from a policy. In doing some tests with the above example, I found I didn't need to have an escaped new character in the parameter, such as \\n. Doing just
worked, whereas the other did not. It was the opposite when using a direct jamf runScript call. Same if I wanted to quote some text in the message. Trying to escape the quotes like "quoted text" failed, but doing "Quoted text" directly in the parameter field worked fine. Just thought I'd mention that in case you run into the same thing.