Skip to main content
Question

Reflector 2 Broadcast name not appearing

  • December 28, 2015
  • 3 replies
  • 17 views

Forum|alt.badge.img+3

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()

3 replies

davidacland
Forum|alt.badge.img+18
  • Valued Contributor
  • December 28, 2015

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.


Forum|alt.badge.img+3
  • Author
  • New Contributor
  • December 30, 2015

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.


davidacland
Forum|alt.badge.img+18
  • Valued Contributor
  • December 30, 2015

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.