     # And finally, add our placeholder view.
     @previewView.addSubView new AppAid.Views.PreviewDefault()
 
+
+
+  # ### Watch Compile
+  #
+  watchCompile: ->
+    {
+      appName
+      vmName
+    } = @options.targetApp
+    thisAppPath = @options.manifest.path
+
+    errBail = (err) ->
+      notify "Error: #{err.message}"
+      @barAutoCompile.setValue 'Manual'
+
+    if @waching then return
+    @watching = true
+    
+    console.log 'Executing watch..'
+    KD.singletons.vmController.run
+      vmName    : vmName
+      withArgs  : "#{thisAppPath}/bin/watch.js ~/Applications/#{appName}"
+      (err, res) =>
+        if err? then return errBail err
+        @watching = false
+
+        coFiles = /\.coffee/.test res
+        cssFiles = /\.css/.test res
+        console.log('Watch returned!', coFiles, cssFiles, res)
+        console.log('autoCompile:', @autoCompile)
+
+        if not @autoCompile then return
+
+        checkPreviewApp = =>
+          console.log 'check preview'
+          if not coFiles then return @watchCompile()
+          @previewApp (err) =>
+            if err? then return errBail err
+            @watchCompile()
+
+        checkPreviewCss = =>
+          console.log 'check css'
+          if not cssFiles then return checkPreviewApp()
+          @previewCss (err) ->
+            if err? then return errBail err
+            checkPreviewApp()
+
+        do checkCompileApp = =>
+          console.log 'check compile'
+          if not coFiles then return checkPreviewCss()
+          @compileApp (err) ->
+            if err? then return errBail err
+            checkPreviewCss()
 
 
 

      # code anyway.
      eval res

  # ### Preview CSS
  #
  previewCss: (callback=->) ->

    @options.targetApp = {}
    # Soon we'll offer targetted VMs, but for now default it.
    @options.targetApp.vmName = @options.vmName


    # Autocompile States.
    # @watching means that the process is currently running.
    @watching = false
    # @autoCompile means that we want to auto compile.
    @autoCompile = false



