Posted on 12-28-2015 10:50 AM
How would i go about the below automator command into a bash script. As I packaged the software with composer correctly and remove the hostname from the Plist of the system I used to build the package, but I wanted for the package to fill in the users hostname under the Broadcast name field in Reflectors preferences.
on connectedDevice() tell application "Reflector 2" activate
end tell
tell application "System Events" keystroke "," using command down
end tell delay 2 tell application "Reflector 2" quit end tell
end connectedDevice
connectedDevice()
Posted on 12-28-2015 11:00 AM
I would try a user level custom config profile with a variable for the value you want.
If that doesn't work, a login script to set the value.
Posted on 12-30-2015 10:56 AM
Where would I do that in? I was just looking for a quick script to add into casper admin when installing the package. As I want it to open the application and then do a Command , to open Preference for the application and then close it. The Automator works with the above commands but don't know how to make it into either a script or use the automator script into casper admin.
Posted on 12-30-2015 11:06 AM
A script that you could use in the JSS would be something like:
#!/bin/sh
osascript <<EOF
on connectedDevice()
tell application "Reflector 2"
activate
end tell
tell application "System Events"
keystroke "," using command down
end tell
delay 2
tell application "Reflector 2"
quit
end tell
end connectedDevice
connectedDevice()
EOF
exit 0
If the user interferes or the finder isn't ready it may fail so I would probably look at config profiles, but hopefully this gets you something working in the mean time.