How do you set a reference programatically? (that is equivelent to manual process in tools/references) Thanks!