Fetching system information

Discussion in 'Mac Programming' started by jashsayani, Feb 7, 2009.

  1. macrumors regular

    jashsayani

    Joined:
    Feb 7, 2009
    Location:
    San Jose, CA
    #1
    I want to make a simple Cocoa app that displays system information like Serial No, HD space, IP Address, OS Info, etc.

    How do I fetch the info and display it in the app ?
     
  2. macrumors newbie

    Joined:
    Feb 7, 2009
    Location:
    USA
    #2
    something like:
    set sysInfo to do shell script "system_profiler SPHardwareDataType"
    display dialog sysInfo
     
  3. thread starter macrumors regular

    jashsayani

    Joined:
    Feb 7, 2009
    Location:
    San Jose, CA
    #3
    Thanks a lot for the reply.

    When I type this in the terminal, I get the basic info:
    Code:
    system_profiler SPHardwareDataType
    Now, how do I separately display Memory, Serial No., Cache, etc.
    Explanation with 2 lines of code (getting info and displaying) would be great as I'm new to Cocoa programming.

    Thanks.
     
  4. macrumors 6502

    Joined:
    Mar 8, 2004
    #4
    typing "man system_profiler" will give you the commands you need to extract the data you want.
     

Share This Page