Jump to content


Photo

Get baseName of slice, named automatically. Or how to deny rename automatically named slices?


  • Please log in to reply
No replies to this topic

#1 dadubki

dadubki

    Fireworks Sparkle

  • Members
  • Pip
  • 1 posts

Posted 22 August 2012 - 01:23 PM

Hello!

I try to get baseName of slice automatically named - this name appear in "Properties" left top but i don`t know how to get it in script.

I`ve made huge webpage a long ago, slices was named automatically according to settings in File \ HTML Setup \ Document Specific.
But now I change all graphics but stay old slices AND in the middle of this layout I`ve created additional slices and a lot of old automatically created slice_names (baseNames) are changed!!!.

I can access to all slices (layers with type "web") in such way:

var layerList = fw.getDocumentDOM().topLayers;
for(i=0; i<layerList.length;i++)
{
	 if (layerList[i].layerType='web')
	 {
			 for (j=0; j<layerList[i].elems.length; j++)
			 {
			 layerList[i].elems[j].baseName=layerList[i].elems[j].name+'_myString' //IS WRONG, is null
			 }
	 }
}


I think there can be three possibilities:

1) access to seeking parameter in my way: layerList[i].elems[j].RIGHT_PARAMETER ---- but what is the parameter???

2) deny to rename automatically named slices - even if not programmatically.

3) maby if I can fix this script, that have been suggested by Adobe in reference (but it doesn`t works!), "slices[i][j]" give me required parameter:
var curRow;
var curCol;
for (curRow = 0; curRow<slices.numRows; curRow++) {
for (curCol=0; curCol<slices.numColumns; curCol++) {
var curSlice = slices[curRow][curCol]; // curSlice is the slice info for the cell at this row & column.
// do whatever processing with curSlice.
}
}
is there anybody who force this code from Adobe to work!!!!???? HOW )?