Send python command

Get help with using AutoHotkey and its commands and hotkeys
Posts: 21
Joined: 05 Mar 2016, 07:36

Send python command

10 Jun 2016, 11:57


I'm using blender a lot and I would like to know if it will be possible to send command/script to it with autohotkey. Blender use python and this is the command I would like to send to:

Code: Select all

bpy.context.object.show_x_ray = True
User avatar
Posts: 112
Joined: 05 Feb 2016, 17:00

Re: Send python command

11 Jun 2016, 12:03

Can't you open a console or something in Blender? ... 53236.html

Once you have the shortcut, you can simulate it in AHK. You could also make AHK script to click on the menu elements to open the console, or to press ALT key to highlight menu shortcuts and then press appropriate letters.

Once the console is open you can type the code there, also using AHK.
Posts: 21
Joined: 05 Mar 2016, 07:36

Re: Send python command

11 Jun 2016, 13:54

That's an idea but I find it not very convevient, I would like something more powerful like dll call or COM Oject or anything else that don't need to open the console, send text, active previous window,etc... thanks for reply

Any other suggestion ?
User avatar
Posts: 1196
Joined: 29 Sep 2013, 17:15
Location: USA

Re: Send python command

11 Jun 2016, 14:53

that would only work if blender has implemented COM support or some dll/cmd parameter stuff for other programs to use. for the years I've used blender, I don't think I've seen or heard of any such thing.
rawr. fear me.
Is it December 21, 2012 yet?
Posts: 7088
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos

Re: Send python command

11 Jun 2016, 22:51

I don't know about Blender, but if it runs Python scripts, I suppose that you could create a COM server in Python and access it from AutoHotkey. For example, pythoncom.RegisterActiveObject + ComObjActive. (I suppose that you would need to create a class extending PyIUnknown, but that's just an educated guess. I don't use Python.)

Another option might be AutoHotkey.dll. I'm pretty sure there are examples on the forums for using it from Python.

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], Chunjee, Saarthak Kamra, Twinbrow and 38 guests