Is it possible to access user variables in Python scripts?

I’d like to ‘automate’ my BOM generation scripts with the contents of some user defined variables, like:

image

does anyone know if it is possible?
If yes, can someone point me to some code example?

Have you tried using ${variable_name} ?

no, but i can ! (not the brightest coder of the lot here talking, but i can proficiently copy paste pre-written code :slight_smile:)

I’m pretty much in the same position . . . I’ve only used my own variables in symbol fields, not in any scripts.

I’m sure someone will be along with more info soon :wink:

The KiCad project file is in JSON format. It is easy to open the file in Python in order to search for the variable name and contents.