       callback?()
 
 
-  openFile:(file)->
+  openFile: (file, app) ->
 
     type = FSItem.getFileType file.getExtension()
 
     switch type
       when 'code','text','unknown'
         log "open with a text editor"
-        @open @defaultApps.text, (appController)-> appController.openFile file
+        @open app or @defaultApps.text,  (appController = @getFrontApp()) =>
+          appController.openFile file
       when 'image'
-        log "open with an image processing app"
+        @open app or @defaultApps.image, (appController = @getFrontApp()) =>
+          appController.openFile file
       when 'video'
         log "open with a video app"
       when 'sound'

      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 and not @appControllers[appOptions.name]
        kodingAppsController.runApp (KD.getAppOptions name), callback
        return

