@mionthebeach – you can regard both of the code snippets as trial balloons to find out if your idea can be implemented into a larger script at all.
Something like a corner stone of a larger building. Or, if we are unlucky, just a brick laying around in the jungle…
Uwe