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

Click here to return to the 'An Applescript Solution' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
An Applescript Solution
Authored by: Rainy Day on Dec 16, '12 01:38:30PM

I'd prefer that DoNotSendSystemKeys were still supported. Or, better than that, Apple should include a menu item and a toolbar shortcut/button option. But in the interim…

Here's what i've learned:
  • Killing the RFBEventHelperd daemon seems to work regardless of the DoNotSendSystemKeys setting.
  • This is a one-shot solution; need to redo it every time you invoke a screen sharing session (not surprising).
  • After you kill the initial RFBEventHelperd daemon, Screen Sharing will startup another one whenever it's moved to the foreground, however the second one doesn't interfere with command-tab, and it will quickly (but not immediately) die if Screen Sharing moves to the background.
I wrote an Applescript to make killing the RFBEventHelperd daemon more convenient. I've placed it in ~/Library/Scripts/Applications/"Screen Sharing"/ for easy access from the Scripts menulet. Save it as an Applescript Application:

	do shell script "$(ps -cxao pid,command | grep RFBEventHelperd | awk '{print \"kill \" $1}')"¬
	    with administrator privileges
	display dialog "This session of Screen Sharing should now ignore Command-Tab." & return ¬
	    & return & "You’ll need to rerun this script for the next Screen Sharing session."¬
	    with icon note buttons {"Okay"} default button 1
end try

I used the name "Kill shared Command-Tabs", but you may call it whatever you like.

Note: If you don't want to display the dialog at the end of script execution, you can reduce the Applescript to this:

do shell script "$(ps -cxao pid,command | grep RFBEventHelperd | awk '{print \"kill \" $1}')"¬
	    with administrator privileges

Theory of operation: The do shell script calls a bash (i.e. Unix) script which looks for the RFBEventHelperd process. The awk command extracts the process ID, and creates a Unix kill command, which is then executed as root (necessary in order to kill RFBEventHelperd, as it is owned by another user… i.e.: _ard).

[ Reply to This | # ]