Ok so I work 3d CAM software ESPRITCAM. It uses Com OBJ very similar to Excel, and has built in Macro editor. I want to call on objects using autohotkey and so far I have been successful with these codes:
Code: Select all
TRY oesprit := ComObjCreate("ESPRIT.APPLICATION")
oesprit .VISIBLE := TRUE
msgbox % isobject(oesprit)
oesprit.NEW
I can create an application Espritcam, make it visible, also make sure its an object, and lastly for a test run call on an object to create a new file within the ESPRIT application.
The issue is when I run multiple instances of this program. So now I try to run an object using COMOBJACTIVE, to call on the active instance of ESPRIT.
Code: Select all
try oesprit:= ComObjActive("ESPRIT.APPLICATION")
msgbox % isobject(oesprit)
when I run this, it does not recognize the object and returns a '0'. When I'm running multiple instances of ESPRIT, I need to run the objects on the current active ESPRIT program or better yet find the specific pointer to each instance of ESPRIT and run objects. I'm sure it has something to do with finding program ID, process ID, or HWND. Just not sure how to go about this. Any help would be greatly appreciated. Thanks