Hovering mouse over something in Blender shows python code, but how does one use it? I know the trick of hovering my mouse over the function I want to perform to reveal its corresponding python code, but i'm not sure how to use this code, for example from vse: menu playback>audio scrubbing and which bit to use:

Scene.use_audio_scrub
bpy.data.scenes["Scene"].use_audio_scrub


I have also looked here, but am none the wiser.

I tried placing the code in the console but got the error message:

&gt;&gt;&gt; bpy.data.scenes["Scene"].use_audio_scrub = true
Traceback (most recent call last):
  File "&lt;blender_console&gt;", line 1, in &lt;module&gt;
NameError: name 'true' is not defined
The error occurs because true is not a python keyword. You meant to use True (capitalized).

Use bpy.context.scene, this gets the active scene instead of a scene name "Scene".

The code usually refers to the operation or the datablock, which the button or UI controls changes or calls.

The following code works.

import bpy

# Next two lines assign absolute values ("True" / "False")
# bpy.context.scene.use_audio_scrub = True
# bpy.context.scene.use_audio_scrub = False

# method changing the use_audio_scrub state
def Custom_Toggle_Audio_Scrub():
    bpy.context.scene.use_audio_scrub = not bpy.context.scene.use_audio_scrub

# call and execute the method
Custom_Toggle_Audio_Scrub()