Created
May 8, 2012 13:10
-
-
Save hilukasz/2634825 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function doActionOnLayer(layerName, functionName) { | |
for (var i = 0; i < numberOfLayers; i++) { | |
var customName = layerName; //layerName should be string | |
var myLayer = app.activeDocument.layers[i]; | |
var myLayer = myLayer.name; | |
if (customName == myLayer) { | |
var myLayerIndex = i; | |
return myLayerIndex; | |
functionName; | |
} | |
else { break; } | |
} | |
} | |
function testFunction() { | |
var alertL = app.activeDocument.layers[myLayerIndex]; | |
var alertL = alertL.name; | |
alert(alertL); //this is to test concept | |
} | |
//run the action | |
doActionOnLayer("note", testFunction()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment