       else optionSet.lastActiveIndex = index
 
 
-
-
-
   # setGroup:-> console.log 'setGroup', arguments
 
   # openFileWithApplication:(file, appPath)->

          options.requestedFromAppManager = yes
          @open name, options, callback
        return
      else if appOptions?.thirdParty and not options.requestedFromAppsController
        kodingAppsController.runApp (KD.getAppOptions name), callback
        return


      callback?()


  openFile: (file, app) ->

    type = FSItem.getFileType file.getExtension()

    switch type
      when 'code','text','unknown'
        log "open with a text editor"
        @open app or @defaultApps.text,  (appController = @getFrontApp()) =>
          appController.openFile file
      when 'image'
        @open app or @defaultApps.image, (appController = @getFrontApp()) =>
          appController.openFile file
      when 'video'
        log "open with a video app"
      when 'sound'
