Omar, thanks for sharing.
But I'm not sure of your intent, since you did not attach a Macro, but you posted to the "Macro Library" sub-forum.
So, I'm changing the sub-forum to "Questions..." for now. If you attach a macro, you can change it back to "Macro Library"
Did you have any questions?
Also, please use the Forum Code Block with "applescript" as the language when you post an AppleScript. I have revised your post to use this.