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


Click here to return to the 'Keep magicJack window hidden' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Keep magicJack window hidden
Authored by: chris79 on Jan 20, '10 10:37:29AM
i use this to automatically launch MagicJack when i plug it in:

#!/bin/bash

# give it 5 sec to get started
/bin/sleep 5

# if the app isn't already running...
if ! (ps -r -axco command | grep splash) && ! (ps -r -axco command | grep mj_dev) && ! (ps -r -axco command | grep magicJack) ; then
	# and the right disk is mounted...
	if [ -e /Volumes/magicJack/.background.png ]; then
		# then start the app
		/usr/bin/open /Volumes/magicJack/Start\ magicJack.app
		# hide the application after 5 seconds
		/bin/sleep 5 && osascript -e 'tell application "System Events" to set visible of process "magicJack" to false'
	fi
fi

launchd XML (i use Lingon.app to set this):

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>Label</key>
	<string>chris.MagicJack.StartOnMount</string>
	<key>ProgramArguments</key>
	<array>
		<string>/path/to/launchMagicJack.sh</string>
	</array>
	<key>StartOnMount</key>
	<true/>
</dict>
</plist>



[ Reply to This | # ]
Keep magicJack window hidden
Authored by: jaek on Apr 10, '10 01:05:56PM

Hello chris79,
Sorry for being such a newb, but how do you use that language to hide the magicjack window? Are you using an application to compile it or just pasting it into an existing file, etc?
Thanks.



[ Reply to This | # ]