How to close the active dialog

Hey there, I want to do two commands at the same time , but I have to close the first one by myself and then the second command works. How to close the dialog automaticly? Thanks.

:button{text="BJ",onclick=function() app.command.MaskByColor() app.command.InvertMask() end}

hi, xtommy!
usually you can insert ui=false:

app.command.InvertColor {

but it seems like this is not possible in this case.

Thank you . This command seems different from others. Maybe I can find another way to do that.

yeah, it was surprising to find out it doesn’t work in this case.
it depends on what you want and if it’s worth it, but what you can do is following:
scan pixels for a colour (let’s say foreground colour), when you find one, store it’s position.
then use the app.useTool, set it to magic wand with contiguous mode set to false and let it hit previously stored position.
that will give you the selection of the colour in the image.
pretty cumbersome imo, clicking ok might be much less painful option

Based on this Add ui parameter to all commands to disable dialog/user interaction on each command · Issue #3025 · aseprite/aseprite · GitHub, it seems that in the future, all commands will have a ui (bool) parameter.

1 Like

thanks, good to know it will be implemented.

I have found another way to do this . A small python script that can deletes all the pixels in the same color,and it’s very fast.

Yes.There are different ways to do this . But it’s better to have than not . :slightly_smiling_face: