I want to assign a keyboard shortcut to toggle this button: 
It is in the UV Editor and its python code or whatever it’s called is: tool_settings.use_uv_select_sync
This did not work:
I have tried other syntax in desperation, such as:
bpy.context.scene.tool_settings.use_uv_select_sync
tool_settings.use_uv_select_sync_false
tool_settings.use_uv_select_sync_toggle
uv.tool_settings.use_uv_select_sync
scene.tool_settings.use_uv_select_sync
context.scene.tool_settings.use_uv_select_sync
…you get the idea. Nothing is working.
Suggestions please?
Input -> Image -> UV Editor:
Thank you!!!
OK, I get it now - so any toggle function can be controlled with the syntax wm.context_toggle
And then the python name of what’s to be toggled goes in Context Attributes.
I’m still trying to learn all the various types of syntax for shortcut assignment. The toggle type was new to me.
Much appreciated.
Yes, there are also wm.context_set_enum to set a particular value for e.g. some dropdown, wm.context_toggle_enum to toggle between two items of a dropdown, and wm.context_cycle_enum to cycle between items.
Awesome! Thank you for elaborating on that!
I have a question about wm.context_set_value actually. You seem like a good person to ask, so…
When I try to assign the UV Vertex Select Mode button (
) to Alt NumPad1 I get this error when I press the shortcut:
Traceback (most recent call last):
File "/Applications/Blender 2.72/Blender 2.72.app/Contents/Resources/2.72/scripts/startup/bl_operators/wm.py", line 329, in execute
if context_path_validate(context, data_path) is Ellipsis:
File "/Applications/Blender 2.72/Blender 2.72.app/Contents/Resources/2.72/scripts/startup/bl_operators/wm.py", line 54, in context_path_validate
value = eval("context.%s" % data_path) if data_path else Ellipsis
File "<string>", line 1
context.'VERTEX'
^
SyntaxError: invalid syntax
location: <unknown location>:-1
Here is how I set it:
Do you know what I did wrong?
Thanks again.
Wait, never mind - I figured out where I messed up. I had the fields flipped!
It should be:
[ATTACH=CONFIG]342200[/ATTACH]