Display Home folder size in menu bar - Xcode

Discussion in 'Mac Programming' started by deba, Jul 5, 2012.

  1. macrumors newbie


    Feb 5, 2006
    Essex, UK

    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.
  2. macrumors 6502a


    Oct 26, 2003
    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.
  3. thread starter macrumors newbie


    Feb 5, 2006
    Essex, UK
    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.
  4. macrumors 6502

    May 29, 2011
    Littleton, 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.

Share This Page