 
   onScriptsChanged: (e) =>
     @level.set 'scripts', @scriptsTreema.data
-    lastAction = @scriptsTreema.trackedActions[@scriptsTreema.getCurrentStateIndex() - 1]
-    return unless lastAction
-
-    if lastAction.action is 'insert' and lastAction.parentPath is '/'
-      newScript = @scriptsTreema.get lastAction.path
-      if newScript.id is undefined
-        @scriptsTreema.disableTracking()
-        @scriptsTreema.set lastAction.path+'/id', 'Script-' + @scriptsTreema.data.length
-        @scriptsTreema.enableTracking()
-        @scriptTreema.refreshDisplay()
-
-    if lastAction.action is 'delete' and lastAction.parentPath[0] is '/'
-      for key, treema of @scriptsTreema.childrenTreemas
-        key = parseInt(key)
-        treema.disableTracking()
-        if /Script-[0-9]*/.test treema.data.id
-          existingKey = parseInt(treema.data.id.substr(7))
-          if existingKey isnt key+1
-            treema.set 'id', 'Script-' + (key+1)
-        treema.enableTracking()
 
   onScriptSelected: (e, selected) =>
     selected = if selected.length > 1 then selected[0].getLastSelectedTreema() else selected[0]

      callbacks:
        change: @onScriptsChanged
        select: @onScriptSelected
      nodeClasses:
        object: ScriptNode
      view: @
    @scriptsTreema = @$el.find('#scripts-treema').treema treemaOptions

    firstRow = @settings.view.scriptTreema?.$el.find('.treema-node:visible').data('instance')
    return unless firstRow?
    firstRow.select()

class PropertiesNode extends TreemaObjectNode
  getUndoDescription: ->
    return '' unless @canUndo()
    trackedActions = @getTrackedActions()
    currentStateIndex = @getCurrentStateIndex()
    return @getTrackedActionDescription( trackedActions[currentStateIndex - 1] )

  getRedoDescription: ->
    return '' unless @canRedo()
    trackedActions = @getTrackedActions()
    currentStateIndex = @getCurrentStateIndex()
    return @getTrackedActionDescription trackedActions[currentStateIndex]

  getTrackedActionDescription: (trackedAction) ->
    switch trackedAction.action
      when 'insert'
        trackedActionDescription = 'Add New Script Property'

      when 'delete'
        trackedActionDescription = 'Delete Script Property'

      when 'edit'
        path = trackedAction.path.split '/'
        trackedActionDescription = 'Edit Script Property'

      else
        trackedActionDescription = ''
    trackedActionDescription

class EventPropsNode extends TreemaNode.nodeMap.string
  valueClass: 'treema-event-props'
