Can I run a Mac application as a PC-style "service" in 10.3 ??

djbeta

Registered
I am hosting a Filemaker database off of my desktop Mac. I keep forgetting and shut down Filemaker when I'm done with other databases.. forgetting that one of my files is being hosted to other people.

Is there a way I could make an application impossible or harder to shut down ? or perhaps a way to have the app run in the background so I don't even see it on my Dock ?
 
Well, the Dock icon is controlled specifically by code in the software, so in order to make it "disappear" from the Dock, you'd have to have access to the source code -- which, of course, is impossible.

What you can do is write an AppleScript, though, that would re-launch FileMaker if you quit it, I think. I'm no expert on AppleScript, though, so maybe someone else can offer insight into whether this is possible.
 
You can also launch it under another user account, and then switch to your regular account.
 
that is the kind of solution I'm hoping for... does that mean that I can run Filemaker twice, once under each user with different files open under each user ?

will the user in the background operate at a degraded performance level ? or is there a way to make it so that that user gets high cpu priority ?

thanks for the tips everyone!
 
Background launching doesn't work. First, you need to launch the program with the "open ./[AppName]" command. Adding & to the end, which is the UNIX way of launching in the background, doesn't work in this situation.

When you launch an application from the terminal, say, Preview.app, you would type "open ./Preview.app" and it will launch. The terminal will not provide you with another prompt until you quit Preview.app. If you add an "&" at the end of that command, you just get back to the prompt immediately -- the program still launches and executes normally.
 
I've got the program running in the "background" under another user now, using fast user switching.

It seems to be working (for now) :)
 
services in Windows have to be written specifically as services. daemons in OS X (or any unix) have to be written specifically also - it's not as hard, but they have to be written separate from the GUI. Apparently FileMaker must have a GUI open to run, so you can't really run it in the background - you'd need to use user switching as others have mentioned.

As for different priorities - there is a command "renice" which will let you change the priorities of running processes; check the man page. Just remember that a higher nice number means a lower priority.

I believe there's a graphical utility called Nicer that you can get off versiontracker - it's basically a friendly front end to the renice command.
 
Would it be possible to make a copy of the FileMaker app and change it's Info.plist file? A key of LSUIElement with a value of 1 will make a Cocoa application run in the background without a dock icon or a menu bar. I haven't tried doing that with any existing apps though.
 
thanks for all the posts guys..
I tried running Filemaker Pro on the other user while logged in with another user using fast user switching.... and Filemaker crashed every time..
(i was running a script loop that sends emails via Applescript).. it doesn't crash when running under the current user... maybe I'll try a different scheduling script ( I was using mmScript OS X preview, but perhaps I'll go with Events) and maybe I'll try one of the other suggestions.. ???? any comments on the last post ?
 
Well, I just tried it with Calculator, but Calculator is a Cocoa app. Whether or not FileMaker has an Info.plist file associated with it, I don't know. But if it did... select FileMaker and choose Show Package Contents. Open the Contents folder and there may be an Info.plist file. Open that (it should open with the Property List editor, but you can use any text editor) and add a new key under Root called LSUIElement with a Boolean value of YES. Then, if you run the app, it won't have a dock icon or a menu bar. If you needed to share a certain database this way, you might setup a startup script or something to open the file you want to share with the "hacked" version of the program.
 
Back
Top