Perspective table Toggle switch Scripting

Please read Wiki - how to post code on this forum - #10 by jlandwerlen and fix the code formatting in the post above. (Use the pencil icon to edit.)

Note that neither pieces of code you have posted could work as you are missing the colon (:) at the end of the if statements.