0

I'm currently creating a plugin on InDesign and I would like to know if it's possible to detect if the user deletes an object ? Because I would need to retrieve the id of the deleted object to remove it from an array.

I didn't find anything in the documentation about this I hope I didn't miss it.

if it's possible, i need to detect it on all elements of all pages.

I was thinking something like:

app.activeDocument.allPages.allItems.addEventListener("delete", function () {
     var idOfDeleteElement = this.id;
})

And also if the user selects several objects to delete, how to do ?

Here is an image to illustrate what I am talking about :

enter image description here

Thank you in advance !

Fitspade
  • 377
  • 1
  • 11
  • 1
    I'm afraid there is no easy direct way to do it. All I can think is to make a panel with button 'Delete' and ask the user to use this button to delete items. This way you could keep track of the changes. – Yuri Khristich Nov 11 '21 at 08:25
  • Yes it's a good compromise, thanks for the idea @YuriKhristich ! – Fitspade Nov 12 '21 at 09:32

1 Answers1

0

The solution of @YuriKhristich is a good compromise :

Create a panel with a delete button and ask the user to use this button to delete items.

Fitspade
  • 377
  • 1
  • 11