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


Click here to return to the 'Always keep an application open' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Always keep an application open
Authored by: lemac on Jun 20, '11 10:59:24AM

This is great. Thanks for posting. Now would there be a way to keep the application hidden?



[ Reply to This | # ]
Always keep an application open
Authored by: shpokas on Jun 20, '11 12:01:24PM

There is, already. Read this: http://www.cocoadev.com/index.pl?LSUIElement



[ Reply to This | # ]
Always keep an application open
Authored by: lemac on Jun 21, '11 03:47:10PM

Thanks for the suggestion. This is quite technical. I am in no way a developer and got lost in the instruction. I was hoping for a simple solution like the one presented in this hint. I don't mind having the icon showing the application open in the dock but would like to hide the window.



[ Reply to This | # ]
Always keep an application open
Authored by: shpokas on Jun 21, '11 11:50:26PM

Maybe this explanation can help, if you want to hide dock icon. (From here: http://growl.info/documentation/hardwaregrowler.php)

Disabling the dock icon:
Because HG doesn't really have any user-interaction features, you may follow these steps to disable the dock icon. Navigate to wherever you placed HG and right-click on it and select "Show Package Contents." Open up contents and then right-click Info.plist. Highlight "Open With" and select TextEdit from the list (If TextEdit is not in the list, choose "Other..." and navigate to TextEdit and click "Open").
Paste the following just after <dict>:
<key>LSUIElement</key>
<true/>



[ Reply to This | # ]
Always keep an application open
Authored by: tedw on Jun 20, '11 03:39:01PM

Not directly through launchd; but then again, I'm not sure why you'd want to do that, so maybe I'm misunderstanding the question. what app are you talking about, and what do you want hidden?



[ Reply to This | # ]
Always keep an application open
Authored by: lemac on Jun 21, '11 05:16:30AM

I remotely connect to my computer at home with an application called TeamViewer. When TW launches it opens a window which provide login information. If you close that window, TW quits. You can't keep the application open without the window.

There are other members of the family who use this computer. They are sometimes distracted and close the window and with it, the application. Your hint comes very handy to prevent this. However, to prevent confusion it would be better if the window would hide when the application opens. You can do this when you add an application in the Login Items.



[ Reply to This | # ]
Always keep an application open
Authored by: tedw on Jun 21, '11 08:48:45AM

Badly designed port of a windows app. You should write the developers and tell them that this is un-Mac-like behavior and they should fix it.

That being said, this is not (IMO) how you should approach this issue. It would be better for you to create a second user account just for work and enable fast user switching. This way you have a handy menu that lets you switch between accounts - you can log into your work account, start the application, then switch to the other account and let your family have at it: the work account and the TW app will run in the some strange background dimension where no one can see it. Just tell your family not to go into your work account on pain of eternal grounding. (you could password the account if you really wanted to, but it would add the extra stop of entering the password when you wanted access).

In fact, you could set up individual accounts for each of your family members so that they could all do their stuff without it mixing in with everyone else's stuff. You'd want to max out your machine's RAM (fast user switching keeps each logged-in account active, which hogs memory).



[ Reply to This | # ]
Always keep an application open
Authored by: Anonymous on Jun 21, '11 11:00:23AM

"you could password the account if you really wanted to"

Oh my goodness. Are you seriously suggesting that users don't apply a password by default? This isn't 1980, you know...



[ Reply to This | # ]
Always keep an application open
Authored by: tedw on Jun 21, '11 11:45:17AM
You'd be surprised. I'm always seeing people over in the forums who share their user accounts with friends, college roommates, random acquaintances. People, I swear…

However, If you're already sharing a user account with your family (and I assume this is a desktop that doesn't travel out of the house where other people could get physical access), then putting a password on your work account would just be to keep your kids/spouse out of it - it wouldn't really be needed for security reasons (unless you're worried about someone breaking into your house late at night so they could update their facebook page).

That being said, if you're going to have an account with no password, do not under any circumstances make it an administrator account or put it on the sudoers list. That would just be dumb.

[ Reply to This | # ]

Always keep an application open
Authored by: lemac on Jun 21, '11 03:04:18PM

Actually, this is a common behavior for applications that won't open more than one window at a time. For instance, Apple's own iPhoto, System Preferences, Dictionary and Calculator will quit on closing the window.

I appreciate your suggestions. I am already using multiple accounts on the computer but I also do remote support for extended family and friends and would like to keep it as simple as possible. A window auto-hide at launch would be just perfect in most cases.



[ Reply to This | # ]
Always keep an application open
Authored by: lemac on Jun 21, '11 03:44:05PM

Thanks for the suggestion. This is quite technical. I am in no way a developer and got lost in the instruction. I was hoping for a simple solution like the one presented in this hint. I don't mind having the icon showing the application open in the dock but would like to hide the window.



[ Reply to This | # ]
Always keep an application open
Authored by: tedw on Jun 21, '11 04:02:47PM

Google the system preferences app Do Something When - I think you can set that up to automatically run a script to hide the app when it's launched.



[ Reply to This | # ]
Always keep an application open
Authored by: lemac on Jun 22, '11 06:53:53AM

I installed this Preference Pane. You can set it to open a document or an app when an app is launched (no option to run a script as such). I am not familiar with applescripts but managed to create an app with Automator that hides the window after launching TeamViewer. It does what I wanted to do. I am an happy camper now! Thanks tedw and everybody else for the kind and appreciated inputs.



[ Reply to This | # ]
Always keep an application open
Authored by: trosberg on Jun 22, '11 01:03:42PM
I thought keeping and hiding an app is easier to carry out with an AppleScript app. An icon more in your Dock, though.
(*
ApplicationHider
Keeps an application running. Hides it, when not in use.
Paste into AppleScript Editor. Save as an application with 'Stay open' ticked. 
Add the script app to your login items in System Preferences.
Tuomas Rosberg 2011
*)

property appName : ""
property firstRun : false

on run
   if firstRun is false then -- this script app hasn't been opened
      set anApp to choose application -- launches and returns item application
      set appName to name of anApp
      set firstRun to true
   else -- firstRun is true in subsequent runs, continue to idling
   end if
end run

on idle
   tell application "System Events"
      if exists of application process appName then
         if frontmost of application process appName is false then
            set visible of application process appName to false
         end if
      else -- the app process does not exist
         tell application "Finder" to launch application appName
      end if
   end tell
   return 3 -- seconds to idle
end idle


[ Reply to This | # ]