INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Automation COM issues  (Read 926 times)

drhyoung

  • Recent member
  • *
  • Posts: 32
Automation COM issues
« on: June 17, 2013, 05:51:11 pm »

Hi

I'm running MC 18 (195) on Windows 8 x64.
I'm intending to use WSH/VBS to build a simple script that will write an XML file to disk when a track on MC changes.

I haven't got into the event triggers yet - just trying to interact with MC18.

I'm using the following:
----
On Error Resume Next
Set mc = GetObject(, "MediaJukebox Application")
If Err.Number = 429 Then
   on error goto 0
   Set mc = CreateObject("MediaJukebox Application")
End If

wscript.echo mc.ispurchased()
set mcz = mc.GetZones()
set mz = mcz.getzone(0)
wscript.echo mz.GetName()
----
I run the script from the Admin CMD window, and have also tried the SYSWOW64 CMD window run by the administrator, and get the same results.
The script seems to work fine when MC is not running.

But if I manually start MC then the script fails.
The CreateObject function seems to maximize any MC window but then hangs until it times out with the error:
>>>(5, 4) Microsoft VBScript runtime error: ActiveX component can't create object: 'MediaJukebox Application'

Any suggestions gratefully appreciated.

David
Logged

drhyoung

  • Recent member
  • *
  • Posts: 32
Re: Automation COM issues
« Reply #1 on: June 17, 2013, 08:16:23 pm »

May be relevant...
In the MC Options, I have "Allow multiple instances to run at one time" un-checked.
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42385
  • Shoes gone again!
Re: Automation COM issues
« Reply #2 on: June 18, 2013, 08:27:38 am »

It's a problem if GetObject(...) isn't finding the running MC.

It could be UAC elevation.  What happens if you run CMD and MC at the same elevation level (probably non-elevated)?
Logged
Matt Ashland, JRiver Media Center

drhyoung

  • Recent member
  • *
  • Posts: 32
Re: Automation COM issues
« Reply #3 on: June 18, 2013, 04:41:59 pm »

Hi Matt

Yes !!

Thanks.
Logged
Pages: [1]   Go Up