Here's a short script that might do what you want (but it removes ALL hidden layers, no matter what their COLOR GROUP)
1. It loops through all the layers creating a list of all inactive layers.
2. Once all inactive layers are found, it will loop through all those layers...
3. Layer by layer, it will display the message "Layer named (name of layer) will be deleted ..."
4. You simply click OK, then that layer is deleted.
5. The original current layer is re-selected and the script is done.
6. Once done, if necessary, ALL the deleted layers can be resurrected in one UNDO operation.
TO USE: Make a new button, then copy the script below and EMBED it in the Embedded GEORGE Script button action, save the button and assign an ICON to the new button.
Code: Select all
Param none
ScriptName = "DeleteHidden"
tv_LayerCurrentID
OriginalLayerID = result
ExitFlag = 0
Counter = 0
SelectedLayerCounter = -1
tv_UndoOpenStack
While ExitFlag == 0
tv_LayerGetID Counter
LayerID = result
IF CMP(LayerID, "none")
Total = Counter - 1
ExitFlag = 1
tv_LayerSet OriginalLayerID
ELSE
tv_LayerInfo LayerID
parse result LDisplay LPosition LOpacity LName LType LStart LEnd LPre_LT LPost_LT LSelection LEditable LStencilState
IF CMP(LDisplay,"OFF")
SelectedLayerCounter = SelectedLayerCounter + 1
LayerInfo(SelectedLayerCounter) = LayerID
LayerName(SelectedLayerCounter) = LName
END
END
Counter = Counter + 1
END
IF SelectedLayerCounter > -1
FOR i = 0 to SelectedLayerCounter
LayerID = LayerInfo(i)
tv_warn "Layer named " LayerName(i) " will be deleted..."
tv_LayerKill LayerID
END
END
tv_LayerSet OriginalLayerID
tv_UndoCloseStack
This is a modification of the script that was posted a few days ago for Peter (that executes the same FX operation on all layers)... its really a simple script that could be adapted to other layer processes as well.
sven