I would like to change the **hide_viewport** state of a collection in a driver. It is unfortunately not possible to add a driver to a collections's states. (It is possible to do this on objects but not on collections.) The problem is that in the driver editor I can't assign a value to a variable (like **var = 0** ) as this results in an *"Invalid Python expression*". Which is a bit silly as this is just a normal variable value assignment in python. In an if statement in the driver editor one can assign a value (**0 if whatever == something**) but this refers to the value of the driven object. As the collection can't have a driver I would like to drive it's states by another object's driver. Is there any way to achieve this? Basically recreating the **bpy.data.collections["Collection_Name"].hide_viewport = True** statement from a script in a driver. (I can't use a script as I intend to append the collections and the driver objects in an empty file. Or can I attach a script to an object so that the script also gets appended with the object?)