Resize jamfhelper utility window

maiksanftenberg
Contributor II

We are putting a little script together to display some information well structured to the user.
But we have more lines as output as jamfhelper and the window options are supporting.

Is there anyway that this can be extended in some way?
So mean: Resize it?

Did not found any option to do so...

Cheers,
Maik

6 REPLIES 6

mm2270
Legendary Contributor III

cocoaDialog is the answer. Its one of the reasons I continue to use it over jamfHelper 99% of the time.
I know, I know, that isn't what you were asking, but, making jamfHelper accept more text or be more flexible is going to be up to JAMF. You can't do anything with the version you have because you would probably need access to the unflattened Utility.nib file that controls the window size (for that window type), but its been optimized or flattened in the version JAMF ships so you can't open it in XCode and manipulate it.

maiksanftenberg
Contributor II

Mike, we use cocoaDialog a lot for other activities.
But with this, I was not able till now to do the following:
XXX: Y
YYY: X
If you can do this, we can use cocoaDialog.

Thanks

mm2270
Legendary Contributor III

@maik.sanftenberg Can you elaborate on what you mean by XXX: Y & YYY:X? I'm not understanding what that means.

maiksanftenberg
Contributor II

We want to have multiple lines that displays various information.
At the moment we work on a customer interface that will displays system information like the following:

Username: first.lastname
Full name: Firstname Lastname
bound Domain: domain name

Hope that clarify things?

mm2270
Legendary Contributor III

OK, so, for something like that, just send all the gathered data into a variable in the script and then use that variable for the --text or --informative-text or whatever in cocoaDialog. Here's an example of what I mean.

#!/bin/sh

username=$(ls -l /dev/console | awk '{print $3}')
fullname=$(dscl . read /Users/$username RealName | awk -F: END{print})
domain=$(dsconfigad -show | awk '/Active Directory Domain/{print $NF}')

text="Username: $username
Full name: $fullname
Bound Domain: $domain"

/Applications/Utilities/cocoaDialog.app/Contents/MacOS/cocoaDialog msgbox 
    --title "" 
    --text "Your information" 
    --informative-text "$text" 
    --icon info 
    --button1 "OK"

Another way to do it is to use echo -e or printf and run a command as the text to display that respects line break characters, such as I've done that at times instead of building a separate variable into the script, but its not quite as readable.

Hope that helps. Post back if you need further assistance with it.

maiksanftenberg
Contributor II

Haha...
Never thought to do it this way!
Will straight test this.
Thanks...