Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

deba

macrumors newbie
Original poster
Feb 5, 2006
2
0
Essex, UK
Hi,

I'm looking for a way to display the size of a users home folder within the menu bar.

I have an apple script which displays to the user the size of their home folder, but would like something a bit more polished by displaying it in the menu bar.

This my First attempts at using Xcode / Obj-c.
 

GorillaPaws

macrumors 6502a
Oct 26, 2003
932
8
Richmond, VA
You're trying to sprint before you learn how to crawl. In order to achieve your goal, you need to:

1. Learn Objective-C and understand the fundamentals of C.
2. Learn the basics of the Cocoa Frameworks.
3. Once you're there you're going to need to write a daemon and use Apple's NSStatusItem class.
4. If you want to ever try to sell it on the app store, you need to learn a bunch of stuff related to the sandboxing api's, and I'm not sure if they're compatible with accessing the disk to calculate the size of the hard drive anyways (I don't think they are but I could be wrong about this.).

What you want to do isn't impossible, but be prepared for a long journey. I think it might be practical to start with a more realistic, shorter-term goal.
 

deba

macrumors newbie
Original poster
Feb 5, 2006
2
0
Essex, UK
You're trying to sprint before you learn how to crawl. In order to achieve your goal, you need to:

1. Learn Objective-C and understand the fundamentals of C.
2. Learn the basics of the Cocoa Frameworks.
3. Once you're there you're going to need to write a daemon and use Apple's NSStatusItem class.
4. If you want to ever try to sell it on the app store, you need to learn a bunch of stuff related to the sandboxing api's, and I'm not sure if they're compatible with accessing the disk to calculate the size of the hard drive anyways (I don't think they are but I could be wrong about this.).

What you want to do isn't impossible, but be prepared for a long journey. I think it might be practical to start with a more realistic, shorter-term goal.

1. I know this
2. Learning
3. I have some example source code for NSStatusItem_Class
4. I have no intension of making an app for sale, this purely for testing

I know there is much to learn, but for now I'm just trying to get this to work, so if anyone can help, It will be much appreciated.
 

Red Menace

macrumors 6502a
May 29, 2011
578
226
Colorado, USA
Unless you are just wanting to learn Objective-C, this can also be done in AppleScriptObjC, where you can use your AppleScript. You don't mention what OS or version of Xcode you are using, but AppleScriptObjC is available in 10.6+ from either Xcode or Lion's Cocoa-AppleScript template.

Either way, just putting up a status item is fairly trivial, and adding a menu isn't much more.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.