<NME> generate-inventory.cocoascript
<BEF> 
// local functions for colors & shadows

function convertHex(hex, opacity) {
    hex = hex.replace('#','');
    r = parseInt(hex.substring(0,2), 16);
    g = parseInt(hex.substring(2,4), 16);
    b = parseInt(hex.substring(4,6), 16);

    result = 'rgba('+r+','+g+','+b+','+opacity+')';
    return "\"" + result + "\"";
}

function formatRGB(cadena) {
    return Math.round(Number(cadena)*255);
}

function componentToHex(c) {
    var hex = c.toString(16);
    return hex.length == 1 ? "0" + hex : hex;
}

function createHexString(r, g, b) {
    // if (showLog) { log(r + " " + g + " " + b) }
    return componentToHex(formatRGB(r)) + componentToHex(formatRGB(g)) + componentToHex(formatRGB(b));
}


// function createColorString()


function calc(value) {
	if (value == nil) { return "0 " }
	return "calc(" + value + "px*\" + " + userDefaults.myRetinaString + " + \") "
}


function calcColor(value) {
	var deleteLastScobe = value.replace(/\)\"/, '')
	return "\" + " + '\"' + deleteLastScobe + ")\""
}

function isFloor(val) {
    return Math.floor(val) == val
}

function niceValue(val, accuracy) {
	if (isFloor(val)) { return val }
	else {
		if (accuracy == nil) { accuracy = 1 }
        try { return val.toFixed(accuracy) }
        catch (e) { return val }
	}
}

// value out -> vout :)
function vout(val) {
	if (userDefaults.myRetinaEnabled == 0) {
    if (scaleInstance == nil) { scaleInstance = new ScaleInventory() }
		return (niceValue(val) * scaleInstance.returnScaleCode()) + ""
	}
	else { return niceValue(val) + "*" + userDefaults.myRetinaString }
}








function GenerateInventory () {}

GenerateInventory.returnLayerName = function(layerName) {
  var newLayerString = GenerateInventory.clearName(layerName) + " = new Layer"
	return newLayerString
}

GenerateInventory.removePath = function(longPath) {
	return longPath.replace(/^.*[\\\/]/, '').trim()
}

GenerateInventory.clearName = function(longName) {
	var clearedName = GenerateInventory.removePath(longName).trim().split(' ').join('_')
	return clearedName.toLowerCase()
}


  else { return removedPathName.trim().split(' ').join('_').toLowerCase() }

}





GenerateInventory.generateOpacity = function(value) {
	if (value == nil) { return "" }
	return br() + "opacity: " + niceValue(value,0)
}


GenerateInventory.generateRotation = function(value) {
	if (value == nil) { return "" }
	return br() + "rotation: " + niceValue(value)
}


GenerateInventory.generateCorner = function(value) {
	if (value == nil) { return "" }
	else if (value == "100%") { return br() + "borderRadius: \"" + value + "\"" }
	return br() + "borderRadius: " + vout(value)
}



GenerateInventory.generateShadows = function(values) {
	if (values == nil) { return "" }
	else if (values.length == 1) {
		var composedShadow = ""
		var value = values[0]

		var color = ""
		if (value[5] != nil && value[4] != nil) { color = br() + "shadowColor: " + convertHex(value[5], value[4]) }

		if (value[0] != nil) { composedShadow += br() + "shadowX: " + vout(value[0]) }
		if (value[1] != nil) { composedShadow += br() + "shadowY: " + vout(value[1]) }
		if (value[2] != nil) { composedShadow += br() + "shadowBlur: " + vout(value[2]) }
		if (value[3] != nil) { composedShadow += br() + "shadowSpread: " + vout(value[3]) }

		return composedShadow + color
	}
	else return ""
}



// FINILIZE THIS
GenerateInventory.generateFilterShadows = function(values) {
	if (values == nil) { return "" }
	else if (values.length == 1) {
		var value = values[0]

		var color = ""
		if (value[5] != nil && value[4] != nil) { color += convertHex(value[5], value[4]) }
		if (color != "") {
			color = color.replace('\"','')
			color = color.replace('\"','')
		}

		var shadowVariable = ""
		// BAD CODE: REFACTORING NEEDED
		// if (userDefaults.myRetinaEnabled == 0) {
			var shadowVariable = br() + "style: {\"" + "-webkit-filter\"" + ": \"" + "drop-shadow" + '('
			shadowVariable += vout(value[0]) + "px " + vout(value[1]) + "px "
			shadowVariable += vout(value[2]) + "px " + color + ')' + "\"" + "}"
		// }
		// else {
		// 	shadowVariable = br() + "style: {\"-webkit-filter\": \"drop-shadow(" + calc(niceValue(value[0]))
		// 	shadowVariable += calc(niceValue(value[1])) + calc(niceValue(value[2])) + calcColor(color) + "}"
		// }

		return shadowVariable
	}
	else return ""
}




GenerateInventory.generateBorders = function(values) {
	if (values == nil) { return "" }
	else if (values.length == 1) {
		var composedBorder = ""
		var value = values[0]

		var color = ""
		if (value[3] != nil && value[4] != nil) { color += br() + "borderColor: "  + convertHex(value[4], value[3]) }

		if (value[1] != nil) { composedBorder += br() + "borderWidth: " + vout(value[1]) }

		return composedBorder + color
	}
	else return ""
}




GenerateInventory.generateBackgrounds = function(values) {
	if (values == nil) { return "" }
	else if (values.length == 1) {
		var value = values[0]

		var color = ""
		if (value[2] != nil && value[1] != nil) { color += br() + "backgroundColor: "  + convertHex(value[2], value[1]) }

		return color
	}
	else return ""
}


GenerateInventory.generateX = function(value) {
  if (value == nil) { return "" }
  // else if (value == 0) { return "" }
	return br() + "x: " + vout(value)
}

GenerateInventory.generateY = function(value) {
  if (value == nil) { return "" }
  // else if (value == 0) { return "" }
	return br() + "y: " + vout(value)
}

GenerateInventory.generateHeight = function(value) {
  if (value == nil || value == 0) { return "" }
	return br() + "height: " + vout(value)
}

GenerateInventory.generateWidth = function(value) {
  if (value == nil || value == 0) { return "" }
	return br() + "width: " + vout(value)
}



// GenerateInventory.generatePosition = function(values) {
// 	if (values == nil || values.length < 4) { return "" }
// 	else {
// 		var width = ""
// 		var height = ""
// 		var x = ""
// 		var y = ""
//
// 		if (values[0] != nil) { width = br() + "width: " + vout(values[0]) }
// 		if (values[1] != nil) { height = br() + "height: " + vout(values[1]) }
// 		if (values[2] != nil) { x = br() + "x: " + vout(values[2]) }
// 		if (values[3] != nil) { y = br() + "y: " + vout(values[3]) }
//
// 		return "" + width + height + x + y
// 	}
// }


GenerateInventory.generateImagePath = function(dirtyPath) {
	return br() + "image: \"images/" + GenerateInventory.removePath(dirtyPath) + ".png\""
}

<MSG> Added basic camelCase function

<DFF> @@ -80,9 +80,18 @@ GenerateInventory.removePath = function(longPath) {
 	return longPath.replace(/^.*[\\\/]/, '').trim()
 }
 
-GenerateInventory.clearName = function(longName) {
-	var clearedName = GenerateInventory.removePath(longName).trim().split(' ').join('_')
-	return clearedName.toLowerCase()
+// GenerateInventory.clearName = function(longName) {
+// 	var clearedName = GenerateInventory.removePath(longName).trim().split(' ').join('_')
+// 	return clearedName.toLowerCase()
+// }
+
+
+
+
+GenerateInventory.clearName = function(str) {
+  return str.replace(/(?:^\w|[A-Z]|\b\w)/g, function(letter, index) {
+    return index == 0 ? letter.toLowerCase() : letter.toUpperCase();
+  }).replace(/\s+/g, '').trim();
 }
 
 

Added basic camelCase function