Problem Related to NSTask in Objective C

Discussion in 'Mac Programming' started by akhilgupta, Jun 23, 2011.

  1. macrumors newbie

    Joined:
    Jun 22, 2011
    Messages:
    1
    #1
    hi everyone,
    currently i m working with NSTask. And i want to execute "system_profiler -xml SPApplicationDataType" command in Terminal Application. Now i m able to execute Terminal application.But i m getting stuck at the point that...How i can write command on terminal window..

    Thanks for any Reply

    akhil
     
  2. Moderator

    robbieduncan

    Staff Member

    Joined:
    Jul 24, 2002
    Messages:
    24,480
    Location:
    London
    #2
    Why do you want to execute it within a Terminal window rather than just executing the system_profiler task itself?
     
  3. macrumors 603

    Joined:
    Aug 9, 2009
    Messages:
    6,404
    #3
    The first problem is that the command is wrong. You've misspelled part of it.

    You gave this:
    Code:
    system_profiler -xml SPApplicationDataType
    
    It should be this:
    Code:
    system_profiler -xml SPApplicationsDataType
    The word Applications must end with an "s".

    Manually enter this command in Terminal:
    Code:
    system_profiler -listDataTypes
    then copy and paste the listed data type you want.
     

Share This Page