BMax apps that aren't on the doc?

Archives Forums/MacOS X Discussion/BMax apps that aren't on the doc?

Banshee(Posted 2007) [#1]
Has anyone figured out a way to make a BlitzMax application run without appearing on the Doc?

I'd be most interested to know, as i'd like to write a background service on my machine - specifically, one that detects when my boss has re-installed Apple Remote Desktop to make sure that i'm always working and not surfing the web.

I have it detecting the install and emailing a resignation if he does it again - but it sits on the doc and is too visible and I find it annoying.

The joys of working for a


Winni(Posted 2007) [#2]
Does it help to just use the application binary from the <yourapplication>.app/Contents/MacOS folder?


Banshee(Posted 2007) [#3]
Cheers Winni it's a step forward, but it seems to also open up terminal even though I compiled the application as a GUI app, am I doing something wrong?

Thank you for your help so far, nearly there :)


Brucey(Posted 2007) [#4]
see http://developer.apple.com/documentation/MacOSX/Conceptual/BPRuntimeConfig/Articles/PListKeys.html

Specifically, the bit about "LSUIElement".

Essentially, you edit the Info.plist file (in the yourapp.app folder), and add two new entries...
<key>LSUIElement</key>
<string>1</string>

EDITed - Should be a "1" in there...

The above-mentioned doc also explains all kinds of things you can hide/do with a Mac app...

HTH


Banshee(Posted 2007) [#5]
Thanks Brucey, that's an interesting document. I already had fun hiding my doc & menus :) (I think a variant of that is going on a colleagues machine for laugh some time soon !)

I am still have trouble getting it to dissapear from the doc though, I compiled as a GUI app and set the info.plist file too:

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

<plist version="1.0">

<dict>

	<key>CFBundleExecutable</key>

	<string>SpyProtector</string>

	<key>CFBundleIconFile</key>

	<string>SpyProtector</string>

	<key>CFBundlePackageType</key>

	<key>APPL</key>
	<key>LSUIElement</key>
	<string>a</string>

</dict>

</plist>


Am I doing something wrong ? I notice APPL is a key value yet I thought it should be a string - so i've tried it as both.


Brucey(Posted 2007) [#6]
Oops.... should pre-read my own posts...

Should be
<string>1</string>


Sorry :-|


Brucey(Posted 2007) [#7]
btw, I haven't actually tested this.

I'm just going by what the docs say :

LSUIElement

If this key is set to “1”, Launch Services runs the application as an agent application. Agent applications do not appear in the Dock or in the Force Quit window. Although they typically run as background applications, they can come to the foreground to present a user interface if desired. A click on a window belonging to an agent application brings that application forward to handle events.

The Dock and loginwindow are two applications that run as agent applications.



Also of interest might be this one : LSUIPresentationMode

This key identifies the initial user-interface mode for the application. You would use this in applications that may need to take over portions of the screen that contain UI elements such as the Dock and menu bar. Most modes affect only UI elements that appear in the content area of the screen, that is, the area of the screen that does not include the menu bar. However, you can request that all UI elements be hidden as well.

Which is really useful, if you want something "full-screen", perhaps.

:-)


Banshee(Posted 2007) [#8]
Sadly it still does not work even when setting the value to 1, in fact I had already tried it. It seems this flag isn't compatible with something within BMax somewhere :(

I'd really like to get to the bottom of this, but fear I lack the skill with OSX.

The LSUIPresentationMode does seem to work btw :) That's the one I was having fun with...


Brucey(Posted 2007) [#9]
Okay... I've just tried it on a new GUI app on mine, and it works - which I must say, is very cool!

Perhaps OS X is caching something?
How about renaming the app / building a renamed app? Then, before you run it, change the Info.plist. (This is what I did).

The icon doesn't appear on the dock. :-)


Banshee(Posted 2007) [#10]
Careful if you ever come to Cambs Brucey, because i'm going to hug you so hard it will hurt !

THANK YOU !

*hug*

:)


Brucey(Posted 2007) [#11]
No worries ;-)

...assuming they ever let me back out of SA....