JDW1

Q: Remotely Send Alert/Beep over LAN

I posted my original question in the following thread:

https://discussions.apple.com/message/21285727?ac_cid=op123456

 

It was recommended that I post here in the AppleScript forum to garner more detailed replies.

 

As you can see from what I wrote in that other thread, I am interested in knowing if there is an existing script that could be used to allow one Mac to trigger a sound (audio file) to play on a remote Mac connected via Ethernet LAN.  I seek to accomplish this via a simple double-click in the Finder or a single-click on a Dock icon.  The remote machine should not require user interaction for the audio file to be remotely played.

 

I look forward to your replies.

 

Thank you.

Posted on Feb 19, 2013 12:04 AM

Close

Q: Remotely Send Alert/Beep over LAN

  • All replies
  • Helpful answers

  • by Frank Caggiano,Helpful

    Frank Caggiano Frank Caggiano Feb 19, 2013 5:33 AM in response to JDW1
    Level 7 (25,782 points)
    Feb 19, 2013 5:33 AM in response to JDW1

    You need to enable Remote Apple Events in the receiving machine, look in n System Preferences->Sharing

     

    Screen Shot 2013-02-19 at 08.27.26.png

     

    Then on the sending machine something like

     

    tell application "System Events"  of machine "eppc://192.168.1.2"

      beep

    end tell

     

    should work (of course the IP address needs to be chaged for your network)

  • by BobHarris,

    BobHarris BobHarris Feb 19, 2013 5:52 AM in response to JDW1
    Level 6 (19,395 points)
    Mac OS X
    Feb 19, 2013 5:52 AM in response to JDW1

    Instead of a fixed IP address, you could also look at the System Preferences -> Sharing -> Computer name field and just under the computer name should be a phrase that says: "Computers on your local network can access your computer at: xxxxxxxxx.local

     

    You could instead use eppc://xxxxxxxxx.local as the target name.

     

    Frank, can you have apple remote events invoke "say" and speak text?  Can you have it do more than use the default system "Beep", such as play a sound file?

     

    I only ask, because a) I'm not an Applescript person, b) in the other thread, JDW1 complained the default iChat beep was not sufficiently strong to get the other person's attention. So I suspect the default system Beep is not going to do it.

  • by Frank Caggiano,

    Frank Caggiano Frank Caggiano Feb 19, 2013 6:05 AM in response to BobHarris
    Level 7 (25,782 points)
    Feb 19, 2013 6:05 AM in response to BobHarris

    Good idea using the computer name if that works in this case never tried it myself all documentation always shows the ip address.

     

    As for invoking other commands, as far as I know any applescript command that is valid on the receiving machine should work. Never tried anything overly complicated have always used this more as a parlor trick' rather then doing real work with it.

     

    Easy enough to test out will try it later when I have a chance.

     

    regards

  • by Frank Caggiano,Helpful

    Frank Caggiano Frank Caggiano Feb 19, 2013 6:40 AM in response to BobHarris
    Level 7 (25,782 points)
    Feb 19, 2013 6:40 AM in response to BobHarris

    Bob

     

    just tried

     

    tell application "System Events" of machine "eppc://pandora.local"

              say "Hello"

    end tell

     

    and it worked

  • by BobHarris,

    BobHarris BobHarris Feb 19, 2013 11:18 AM in response to Frank Caggiano
    Level 6 (19,395 points)
    Mac OS X
    Feb 19, 2013 11:18 AM in response to Frank Caggiano

    Frank,

     

    Sweet!

     

    I just tried it myself.

     

    Now JDW1 can use Applications -> Utilities -> Applescript Editor to enter your tiny bit of Applescript, modify the "Hello" string to be as long as desired, and say what will get the attention of the other user.

     

    Save the script as an application.  Now put that Applescript application anywhere they like for double-clicking, or drag the Applescript Application to the Dock for single click activation.

  • by JDW1,Solvedanswer

    JDW1 JDW1 Feb 19, 2013 4:36 PM in response to BobHarris
    Level 1 (18 points)
    Mac OS X
    Feb 19, 2013 4:36 PM in response to BobHarris

    Thank you for the replies here.  I will note this for the future.  But for now, Bob's reply in my other thread, suggesting the use of Messages/iChat over Bonjour answered my question.