All Forces

Design, Music & Mac Geekery

Back to My Mac through iChat

77 Comments
by Melvin Rivera
Updated: Oct 8th, 2009

Remote Home Mac through iChat

One of the new features of Mac OS 10.5, a.k.a. Leopard, is .Mac’s Back to My Mac, a way to connect to your computer at home remotely. Back to My Mac allows a user log into another Mac remotely via internet. This is a great feature but it is only available if you are a .Mac subscriber. However, the new iChat supports Screen Sharing, so the only thing to figure out is how to auto-accept a Screen Share invitation and how to do it securely. This quick tutorial will show you how set up iChat to do just that.

Requirements:

This set up requires that both computers run Leopard. If you don’t have it yet, here’s the Amazon link to buy it. It is well worth the price. You also need two separate iChat supported IM accounts, one for each computer. This could be AIM, .Mac or Jabber accounts.


Step 1: Limit Users

It is very important this step is not skipped. Not limiting the users will open up to anyone taking over your computer.

iChat - Limit Account

From your Mac at home, launch iChat and from the top menu select iChat > Preferences and from the Accounts tab select your account from the Accounts list on the left panel.

iChat - Limit User

From the Security tab, select Allow Specific People and add the username of the ichat account you would like to allow to auto-connect.

Step 2: Set Up Auto Accept Screen Sharing

iChat Alerts

From the Alerts tab in the ‘iChat > Preferences’, select Audio Invitation from the Event pull down menu. Then check-mark Run AppleScript and select Auto Accept.applescript from the pulldown menu. You can close the Preferences window now.

Auto Accept File Location

Now, we’ll need to edit the Auto Accept script we selected in the previous step. Click on the desktop to go to the Finder and from a new Finder window, navigate to ‘Your Hard Disk/Library/Scripts/iChat/’. This is the folder that contains the iChat AppleScripts provided by Apple in Leopard. Double click the file Auto Accept.applescript to open in AppleScript Utility.

Editing Auto Accept Script

A Screen Sharing invitation is sent to iChat as an Audio chat with a Screen Sharing flag. We will need to locate the audio invitation section and comment out the screen sharing if statement by enclosing the lines with (* and *). See example bellow. Additions are marked in red.


on received audio invitation theText from theBuddy for theChat
   (* if (screen sharing of theChat is none) then *)
    accept theChat
  (* end if *)
end received audio invitation

Save the document and quit AppleScript Utility.

Step 3: Set Home Computer To Stay Awake

Energy Settings

Next, we need to set the home computer to stay stay awake, otherwise it will automatically go to sleep when not in use. From the top menu bar, select ‘Apple > System Preferences’ and click on the Energy Saver Preference Pane. From the Sleep tab, set the Computer sleep mode to never and check-mark the Put the hard disk to sleep option then quit System Preferences.

Step 4: Connect Remotely

iChat - Buddy List

Now we’re going to connect to our home Mac. From the other computer, add the username to the buddy list, select it and click the ‘Start Screen Sharing’ button on the bottom right of the buddy list window.

iChat - Ask to Share Screen

From the ‘Start Screen Sharing’ pull down menu, select ‘Ask to Share Username’s Screen…’ to begin the process.

IChat - Screen Sharing Connecting

iChat will ask permission on the Home account, but it will be automatically approved by our script there.

iChat - Screen Sharing Starting

IChat - Screen Sharing Connected

iChat will do it’s magic and your screen will shrink down to the corner as the remote Mac at home will go full screen.

Conclusion

I thought ‘Back to My Mac’ was going to be the .Mac feature that will make me renew my .Mac subscription, but the new iChat has proven more capable than the demo Steve made in his keynote.

P.S. The best way to transfer files is to actually use iChat to send the files. Screen Sharing goes full screen making it impossible to drag and drop. However, If you have a double monitor set up, it is possible to transfer files back and forth by using the second screen.

77 Comments

  • Bug says:

    @Randon: No, once a computer sleeps, the processor itself stops, and it can only be awoken by keyboard or mouse events, which are hardware-level.

  • gabriel says:

    for those of you having the problem that any user is auto-accepted, modify the same Auto Accept applescript to the following, replacing YOUR_NAME_HERE with the IM name you want to be auto-accepted:

    using terms from application “iChat”

    on received text invitation theText from theBuddy for theChat
    accept theChat
    end received text invitation

    on received audio invitation theText from theBuddy for theChat
    if (the handle of theBuddy is “YOUR_NAME_HERE”) then
    accept theChat
    end if
    end received audio invitation

    on received video invitation theText from theBuddy for theChat
    if (screen sharing of theChat is none) then
    accept theChat
    end if
    end received video invitation

    on received file transfer invitation theFileTransfer
    accept theFileTransfer
    end received file transfer invitation

    end using terms from

  • eteela says:

    Great suggestion on editing the applescript. I hadn’t even noticed it was there. If I can make an improvement on the process though-

    duplicate the applescript renaming it autoaccept w-screenshare
    and remove the if logic loops regarding screensharing

    using terms from application “iChat”

    on received text invitation theText from theBuddy for theChat
    accept theChat
    end received text invitation

    on received audio invitation theText from theBuddy for theChat
    accept theChat
    end received audio invitation

    on received video invitation theText from theBuddy for theChat
    accept theChat
    end received video invitation

    on received file transfer invitation theFileTransfer
    accept theFileTransfer
    end received file transfer invitation

    end using terms from

    -this should auto accept text, audio, video, and file transfers whether or not they have screen sharing requests attached to them.

    Then I would enable this script by specific user by using ‘show info’ about a particular buddy in your buddy list and under ‘events’ select audio and/or video request and use the apple script option (autoaccept w-screenshare) that we just created.
    Use selectively for very trusted people only.

    Instead of enabling this globally for all users as would be done by enabling it via iChat preferences and restricting users that can access this account.

    Hope this helps, I’ve had no luck with ‘back to my mac’ either

  • luxLEO says:

    OK! What am I doing wrong?

    I’m totally hip with y’alls success, and I can’t wait to get this working since I have to frequently remote access one of my IT client’s Macs.

    I think I’ve followed all the script changes properly. I’m running iChat on an iMac and a MBP (both current Leopard and up to date).

    This is the error message I keep getting: Failed to start Screen Shared because: Screen sharing could not be established.

    Help, please.

  • Brian Geddes says:

    Great idea, I really love this. I too thought about signing up for .Mac for this feature alone.

    However, when I try to connect I get a connection timed out error. This maybe due to I need to forward some ports on my router or the fact that I’m on my college’s network.

  • Baileyman says:

    With all the talk here about setting up a google talk account because of it’s better security levels (SSL), there does not appear to be a way to limit auto accepting screen sharing for gmail/jabber accounts like you can in AIM account preferences. Thus it appears to me that if you set this up as described above for a google chat account and have modified your autoaccept script, there is nothing limiting ANYONE form controlling your mac.

    Could anyone explain for the rest of us if I am wrong here and how? Thanks!

  • baileyman says:

    So has anyone been able to solve the problem of the common script error that pops up with this concept? No matter which versions of the autoaccept script I try, I still get errors that require disabling the script.

    Any solutions or explanations would be appreciated.

    Thanks!

  • seabass says:

    Has anyone who has updated to 10.5.3 begun getting connection errors when you try and connect from another computer now? Is this just coincidence that this begun for me right after i updated or are others dealing with this too?

  • Jim says:

    Mine still works after upgrading to 10.5.3.
    I too had the good fortune of finding out that if my boy had his account up and I tried to contact home, whatever I initiated, chat, video, or screen sharing, it automatically accepted. I read the above posts and did what eteela suggested:
    I disabled the auto run script in general alerts
    “Then I would enable this script by specific user by using ’show info’ about a particular buddy in your buddy list and under ‘events’” (I used the Alerts tab) “select audio and/or video request and use the apple script option”. I am using the original script.
    Now the only one who can automatically start screen sharing is my work account.

  • Frank Graham says:

    In this process, do you set up your own .Mac account on the computer you want to view? If yes, then do you connect via ichat using the same account?

Leave a Reply


Contact Me