Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.6: Switch remote iChat shared screen back without disrupting the user Apps
Snow Leopard only hintGood news for folks who remote control screens over the internet with iChat. Now you can use the plugging in of a USB flash drive, or any other mountable device, to automatically signal your Mac to switch from the remote computer screen back to yours. You no longer have to rudely interrupt the user at the other end by moving their cursor out from under them. And you don't have to communicate with them in advance to warn them about it. They remain blissfully unaware of your leaving and returning.

Only tested on Snow Leopard (10.6.6.).

Note: This hint requires Universal Access to be enabled. To make sure it is go to System Preferences » Universal Access and check 'Enable access for assistive devices.' I believe it is checked by default in 10.6.x.

Here's what to do:
  • Copy this script into a new AppleScript Editor document and save it as file format Application and with the 'Stay Open' checkbox checked. Name it something useful like 'Trigger Shared Screen Back To My Screen.'
  • Insert a USB flash drive into your Mac and rename its volume to 'Trigger'; case doesn't matter. If it was already mounted make sure it will eject. It must be ejectable for this application to work.
  • Start this application. It will eject the volume.
  • Start your remote screen sharing session.
  • Whenever you want to revert back to your screen without involving the remote computer, unplug the flash drive and plug it in again. Once you regain control of your screen the flash drive will automatically eject again to become ready for the next trigger.
  • When you are done with all screen sharing Quit this application via one of the usual methods.
Note: Any externally mounted device will do: external hard drive, memory card reader, camera, cell phone, etc. Be aware that if the device is chargable via the USB cable you could be reducing battery life if you plug it in and out an extreme number of times.

Tip: Use a USB extension cable to keep the flash drive within easy reach, or consider using a USB Mini Memory Card reader with a long cable for easy reach. I find it easier plugging memory cards in and out of a slot than plugging USB cables.

Another tip: After you click on the miniature window to go back to the remote screen, if you don't further move the mouse the remote user will see no disruption of their cursor location or current activity.

I also have a version which doesn't require Universal Access to be turned on, but the screen switch is done under iChat's nose so its miniature window still acts like you haven't switched back yet. (Everything still functions normally, you can click it to go back to the remote machine, it's just doesn't show the correct computer screen inside it until you do.)
-- Trigger A Shared Screen To Background - AppleScript

-- Only tested on Snow Leopard (10.6.6.) Coded January 10, 2011

property volumeName : "Trigger"
property IdleWaitSeconds : 5 -- recheck mounted volumes this often

on run
  -- All work is done in the idle handler
end run

property idleRecurse : false
on idle
  if idleRecurse then return IdleWaitSeconds
  try
    set idelRecurse to true
    
    -- Note: Can't use Finder because if user has preferences set to not show
    -- mounted volumes on the desktop they won't be in its items.
    set allDisks to do shell script "ls /Volumes"
    set allDisks to every paragraph of allDisks
    log allDisks
    if allDisks contains volumeName then
      -- re-eject the trigger volume
      set ejectResult to do shell script "diskutil unmount " & quoted form of ("/Volumes/" & volumeName)
      if application "iChat" is running then -- New in Leopard
        tell application "iChat"
          if exists active av chat then
            -- There is a video chat or screen sharing. Screen sharing shows
            -- up as an audio chat.
            set isScreenSharing to (count of video chats) is 0
            if isScreenSharing then
              tell application "System Events"
                tell process "iChat"
                  repeat with aWindow in windows
                    set wTitle to title of aWindow as string
                    if wTitle is "My Computer" then
                      click button 2 of aWindow
                    end if
                  end repeat
                end tell
              end tell
            end if
          end if
        end tell
      end if
    end if
    
  on error errorMsg number errNumber
    log "Idle error: " & errorMsg & ": " & errNumber
  end try
  
  set idelRecurse to false
end idle


[crarko adds: I haven't tested this one. It also looks to me that Universal Access is enabled by default in Snow Leopard.]
    •    
  • Currently 3.40 / 5
  You rated: 5 / 5 (5 votes cast)
 
[4,880 views]  

10.6: Switch remote iChat shared screen back without disrupting the user | 6 comments | Create New Account
Click here to return to the '10.6: Switch remote iChat shared screen back without disrupting the user' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.6: Switch remote iChat shared screen back without disrupting the user
Authored by: SeanAhern on Jan 12, '11 09:53:28AM

Correct me if I'm wrong, but can't you just hit the Power button on a laptop to bring up the "Are you sure you want to shut down your computer now?" dialog? Once that's up, you can switch to any application away from iChat. And all without disturbing the user on the other end. Once you're in another app, you can dismiss the shut down dialog. I could be misremembering, though.



[ Reply to This | # ]
10.6: Switch remote iChat shared screen back without disrupting the user
Authored by: fracai on Jan 12, '11 10:30:09AM

Yes, or if you use Spaces, you can use the keyboard shortcuts to change to another Space.

---
i am jack's amusing sig file



[ Reply to This | # ]
10.6: Switch remote iChat shared screen back without disrupting the user
Authored by: withdave on Jan 12, '11 04:38:32PM

Here is an Apple discussion board message about using the power button on a Mac portable to regain control of your Mac without moving the mouse. This doesn't work for my Mac mini.

http://discussions.apple.com/thread.jspa?messageID=11607637



[ Reply to This | # ]
10.6: Switch remote iChat shared screen back without disrupting the user
Authored by: withdave on Jan 12, '11 04:40:10PM

Here is an Apple discussion board message about using the power button on a Mac portable to regain control of your Mac without moving the mouse. This doesn't work for my Mac mini.

http://discussions.apple.com/thread.jspa?messageID=11607637



[ Reply to This | # ]
10.6: Switch remote iChat shared screen back without disrupting the user
Authored by: withdave on Jan 12, '11 04:44:35PM

Using Spaces won't work. All keyboard and mouse events are sent to the remote computer (other than clicking in the miniature screen window.) If it were otherwise, you would not be able to use the same key sequence to change spaces on the remote Mac.



[ Reply to This | # ]
10.6: Switch remote iChat shared screen back without disrupting the user
Authored by: Unsoluble on Jan 13, '11 03:10:53PM

Not all keyboard events are sent to the remote computer -- hitting the Control-Eject shortcut brings up the Sleep/Restart/Shutdown dialog on your local machine, not the remote client. (Works during Remote Desktop sessions too, btw.)



[ Reply to This | # ]