Delete a guide based on coordinate

I would like to know if it is possible to delete a guide based on the coordinate

to find the coordinate I use this → guide.coordinate
but I can’t find the method to delete the guide.

I tried with alchemist but I don’t get any input.

You can use DOM

It’s worth noting, if you’re using BatchPlay, guides are deleted by index, not by location. To delete a guide by location, you have to fetch the guide list, iterate the list to find the guide you want based on it’s location, then delete that guide by index. If you’re doing more than one, you’ll also want to make sure to delete them in reverse, as the later indexes change every time you delete one.

I managed to find the method to delete the guides

the problem is that it starts deleting from the first one created and I need it to start deleting from the last one created

Or you could store all guide instances and then delete them all at once. Guides in UXP dom have its own internal id. So it order doesn’t matter if you make a list to delete first and then delete it.

1 Like

@Jarda Interesting, I wonder how long that’s been available. I think that didn’t exist when I built GuideGuide, but it’s entirely possible I overlooked it. Thanks for pointing that out.