script for deleting empty layers

Hi guys

I tried to use chat GPT for this simple script as im no progframmer - couldnt get it done.
Can someone know how to create a simple script like this?

Much appreciated - many thanks if someone could help out

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
SimonBourgeois's picture

Hi,

You can use this:

(
	for i = layerManager.count-1 to 1 by -1 do layerManager.deleteLayerByName (layerManager.getLayer i).name
)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.