Save as events not working consistently as Save events

Using LO Version: 5.0.2.2 with OSX 10.10.5

Attached you’ll find a simple document with one line of text

which has the following macros attached to the following events

Event save document – Macro1 BEFORE_SAVE

Event Document has been saved – Macro2 AFTER_SAVE

Event Save Document As – Macro3 BEFORE_SAVE_AS

Event Document has been saved as – Macro4 After_SAVE_AS

Now if you SAVE the document the following happens:

Macro1 executes – the saving of the document – and then Macro2 executes

BUT if you SAVE AS the document the following happens:

the save as prompt window – then Macro3 executes and then Macro4 executes.

My question is:

Is this a BUG

or have I missed something?

TESTING_SAVE_EVENT.odt

It is working correctly.

I have added to the Macro “BEFORE_SAVE_AS” some code to insert text into the document. When I “Save as” the prompt window comes up, enter new file name, BEFORE_SAVE_AS Macro runs, text is inserted, message box 3, message box 4.

Make sure you set a new file name in the “Save as” and not accept the current file name otherwise it just does a Save and the Macro 1 and 2 operate.

EDITED
@jayArr I think you are misunderstanding how the program works. When you click on “Save as” the pop up interface open so that the file details can be input. When you click on “OK” the file is saved according to the specification and it is at this time the “Save as” event is triggered. There is no extra window with “Save” so the event fires then. You cannot have the “Save as” event before saving is about to take place and this is when the “OK” is pressed.
I can understand the need to be able to set the file name in a Macro. There would need to be an event which fired when the pop up appears which could then be used to access the pop up and set the file details. I don’t think there is such an event.
However you can Save a document using a Macro with the command:-
storeToURL(“file:///path/to/file.odt”, Args(0)).

Forgive me, but I think you may have missed the point I was making.

My interpretation of the order of events is is that
Macro 3 should execute BEFORE the prompt window and NOT after.

just like the BEFORE SAVE event macro does. If not, then what’s the point
of the event you might just as well have ONE save as event that executes
AFTER the save as window prompt.

This is particularly pertinent to those users (like me) who want maximum control
of the save as and be able to supply the filename BEFORE the window prompt appears.

@jayArr I have edited my reply as it is too long for a comment.