Je viens de m'apercevoir qu'il y a un bug dans les scripts pour sélectionner un calque.
Voilà ce que propose le Corel PaintShop Pro Scripting guide :
Ce fragment de code va permettre de sauvegarder le calque actif et de sélectionner tous les calques en partant du bas, puis de sélectionner le calque de départ :
Code : Tout sélectionner
def Do(Environment):
# get the path from the bottom from the active layer so we can restore it when done
Props = App.Do( Environment, 'ReturnLayerProperties' )
PathBack = Props[ 'Path' ]
# start by selecting the bottommost layer in the image.
App.Do( Environment, 'SelectLayer', { 'Path': (9999,-9999, [], False ) } )
FoundLayer = True
while FoundLayer == True:
LayerName = GetCurrentLayerName( Environment, App.TargetDocument)
# go to the next layer
FoundLayer = App.Do( Environment, 'SelectNextLayer' )
# now that the loop is done, select the bottom layer and then
# use the pathback to restore the layer that was active when we started
App.Do( Environment, 'SelectLayer', { 'Path': (9999,-9999, [], False ) } )
App.Do( Environment, 'SelectLayer', { 'Path': PathBack } )
Si quelqu'un a une idée pour contourner cette erreur...