Script - Sorting projects with no tasks - OF2 mac

Hello, I am new about script.
(1) I am looking for a simple script which could sort all project without any tasks. It is for making a new next action.
(2) Please could you also explain how to make it work I dont know how to install and use scripts on my mac
Thank you very much indeed for your time and help. Best regards