How to pause macro on weekends

I want to pause the macro on weekends. i.e. Pause it Friday end and then restart on Monday start. How can I do it?

Two ways:

Start your macro with the API and check the date before starting. Ex. Task Scheduler on windows.

Use if and javascript to check the date directly in the macro

Thanks how can I know the “day” of the week with javascript?

Here Javascript to detect date

Thank you. How to get the day from this?

I sugges yout to run macro on some days because ui vision duriing running macro execution use more ram.