Usage of .uno:CompressGraphic in LO Basic macro ?

Hello,

I tried to use .executeDispatch(document,".uno:CompressGraphic", “”, 0, Array()) in a LibreOffice Basic macro,
thinking it would call the “compress graphic” menu and apply the default compression (which is exactly what I want)

It doesn’t, and I’m quite stuck, because I don’t know exactly the nature of the properties I should send in the array. I can’t find a complete documentation about the usage of the different dispatchers… (this one in particular…)
Recording a macro doesn’t work, since it does not really record the call of the compress graphic menu.

So, when I use my macro, it opens the menu and stops. Any solution that can get me past this stage is OK for me (even a way to simulate the OK menu button inside the macro, to get past the menu, but I don’t think it can be done.)

Since yesterday I’m searching for documentations, but I can’t find anything … Well, I can find many documentations, but not the usage of the call of each dispatcher !

(I’m doing this in writer, but I think it can be done in calc, etc. ?)

Thank you for your time :slight_smile:

Well, for now, I press “enter” every time the menu pops.
It’s OK for me, I can work at a correct pace using this method.
Well, if anyone knew the answer, it could be very interesting anyway !
(I even tried to take a look in the sources, but it’s beyond my capabilities…)

I have a similar problem. As I understand, .uno:CompressGraphic does not accept any parameters, just calls a dialog https://github.com/LibreOffice/core/blob/master/svx/sdi/svx.sdi#L4492