There was some syntax errors, but fixing and combining the answers from the referenced post makes that code that works fine.
There was some syntax errors, but fixing and combining the answers from the referenced post makes that code that works fine.