I have found an illustrator script which i want to use in photoshop as both softwares are made by same company there wont be any problems given some minor changes. I want to convert the object method in illustrator to selection method in photoshop but i could not find any proper references of it in photoshop scripting documentations, any help will be appreciated. I am using extend script for debugging and writing code.
function getDefFill(){
defObj = activeDocument.selection;
if (defObj.typename == "SpotColor")
{
defObj = activeDocument.defaultFillColor.spot.color;
}
if(defObj.typename=="RGBColor"){
return(defObj.red+","+defObj.green+","+defObj.blue);
}
else
if(defObj.typename=="CMYKColor"){
return( defObj.cyan+","+defObj.magenta+","+defObj.yellow+","+defObj.black);
}
else{
alert(defObj.typename+" not understood");
return ("0,0,0,0");}
}