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

      callback?()


  openFile:(file)->

    type = FSItem.getFileType file.getExtension()

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

      else optionSet.lastActiveIndex = index


  # setGroup:-> console.log 'setGroup', arguments

  # openFileWithApplication:(file, appPath)->
