In the version below MoBu 2009y, a function call ExecuteScript class FBApplication does not even score anything. However, when developing their tools, even Today can be very usefull of a call to a script.

Out of this situation is as follows.

Enlisted on custom scripts necessary files ActionScript.txt

[ScriptFiles]
Script1 = NewCamera.py

Assign keyboard combinations for scripts in the current configuration file (in my case it Maya.txt)

action.global.script1 = {SHFT:F1*DN}

Now, to call a script you can use the WinAPI, simulating pressing keys on the keyboard. For example:

//– hold shift key
keybd_event( VK_SHIFT, MapVirtualKey( VK_SHIFT, 0 ), 0, 0 );

//– press F2
keybd_event( VK_F5, MapVirtualKey( VK_F5, 0), 0, 0 ); // key_down event
keybd_event( VK_F5, MapVirtualKey( VK_F5, 0), KEYEVENTF_KEYUP | 0, 0 ); // key_up event

//– release shift key
keybd_event( VK_SHIFT, MapVirtualKey( VK_SHIFT, 0 ), KEYEVENTF_KEYUP, 0 );

Here’s a trick, good luck!

FBApplication ExecuteScript
Tagged on:     

Leave a Reply

Your email address will not be published. Required fields are marked *