How can I write an autostarting dock app for the Mac? - macos

I have an application I'd like to build that starts when you start the mac and will appear in the dock.
I have some experience with Objective-C and iPhone dev but none with Mac dev, I'm also a PC user normally so I'm not au fait with the norms of Mac usage. Any guidance here is appreciated.
How do you get an application to autostart?
*edit Can you run an app in the status bar? (with the clock etc) or do apps only run in the dock?

To write a program in the Status Bar check out this great tutorial.
To get an application to auto start on login, look for information on launch daemon or just make your application installer to place an entry on /Library/StartupItems.
About the dock: usually, user controls what's on his/her dock. When your UI application is running, it will usually be in the dock. If you want the icon to stick there permanently, you will need the user dragging the icon from the Finder to the dock, or, right-click on the dock icon while is running in select Options->Keep In Dock menu option.

Related

How can I make any icon on the Mac dock bounce?

I would like to be able to make an app's icon on the dock, for any application, bounce with a keyboard command. Is there any way I can do this?
It would need to work on all application icons, so for example which ever application is currently in use, the keyboard command would make that icon bounce like it does when the application is opening - although preferably it could bounce just once.
I presume some sort of script?
Thanks

How to open any built-in app through application

my mac os application is running in full screen mode.
On button click i'm opening finder window which allow me to open any another file or application but problem is that, when i open any another app, screen switches back to xCode and that application opens. Need to open selected app/file above same window.
I have tried:
**[[NSWorkspace sharedWorkspace] launchApplication:path];**
passing application path to launchAppication method
How can i do this?????
Help
The issue is basically because using [NSView enterFullScreenMode:withOption:] will set the app's [NSWindow level] to kCGMaximumWindowLevel - 1, so that all other app's windows will appear behind it.
This is kinda what you would expect from a fullscreen app, which implies system-modal behaviour.
I guess the only way of allowing another app to appear in front of the fullscreen app would be to lower the window level, however I have no idea what effect that would have.

Keep status bar app from showing icon in the dock

I created a status bar app for the mac a few weeks ago. However, whenever I run the app, the dock icon shows up alone with the item in the status bar. Is there a way to keep the app from appearing in the dock?
I can't write comments but to what #Michael Dautermann wrote I'd suggest using the LSUIElement key.
You've said that it's a status bar app, so it has a UI.
LSUIElement (String - OS X) specifies whether the app runs as an agent app. If this key is set to “1”, Launch Services runs the app as an agent app. Agent apps do not appear in the Dock or in the Force Quit window. Although they typically run as background apps, they can come to the foreground to present a user interface if desired. A click on a window belonging to an agent app brings that app forward to handle events.
The Dock and loginwindow are two apps that run as agent apps.
Despite what the docs say it is a String so you can also set this as bool.
Yes, set the LSBackgroundOnly key in your app's "Info.plist" file.

How to create Dock icon option for Mac application on Mac OSx?

On Mac, iTune application have dock menu option. i.e. after right clicking iTune Dock icon, we get options such as Repeat/Shuffle etc. How to create such option for any Mac application? Your help will be greatly appreciated.

Menu Bar app being launched by Dock Icon (Mac OS X)

I'm working on a Menu Bar app and I've added the LSUIElement so the icon won't appear in the dock when the app is in use (And also to remove the File, Edit, View etc at the left of the menu bar).
The problem is that I want the app to be launched by the Icon and by adding the LSUIElement the only way to luanch the app is thru xcode.
I've seen that in the Mac app Caffiene it launches by the icon but it doesn't appear in the dock that it's running etc which is excatly what I want/need.
So I was wondering if you guys know how to do this.
Thank you in advance!
If you want to have a dock icon but not show the app as running in the Dock, simply create two applications:
Status Menu Application
This is the actual application that sets up the menu and contains the application's logic. It has LSUIElement set.
Launcher Application
This application has a dock icon. It contains the status menu application in its bundle. Its sole job is to launch the status menu application and then quit itself.
There is a really simple way to do this without creating a separate launcher app. Build your application, which has a status item, as an app bundle. Then, add an entry to the application's Info.plist file
Key: NSUIElement
Value: Number, 1 or Boolean True
NSUIElement tells OSX if the app should display in the Dock or not.

Resources