Limits to scripting

Post a reply

Smilies
:D :) :( :o :-? 8) :lol: :x :P :oops: :cry: :evil: :roll: :wink:

BBCode is ON
[img] is ON
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Limits to scripting

by Lowlander » Thu Jan 13, 2005 2:50 pm

Thx

by jiri » Thu Jan 13, 2005 2:13 pm

The COM objects in MM are registered once you execute MM.exe, so if you have MM running on the same machine as the language you want to use (e.g. ASP), you can easily use all COM objects in MM.

Jiri

by Lowlander » Thu Jan 13, 2005 1:17 pm

I'd like to know how to get ASP to work with MM. Does that mean I have to install the COM object on the webserver? And if so how would that be done?

by sadao » Thu Jan 13, 2005 12:44 pm

parkint wrote:The COM object works brilliantly for scripting. I personally prefer PHP, and so use that almost exclusively to automate MM.
That's pretty cool. I've been using PHP for a little while so I guess I can apply what I've learnt.

What do you automate?

by parkint » Thu Jan 13, 2005 12:05 pm

Absolutely, it is this easy from within a PHP script:

Code: Select all

//Connect to MM
	$objSDB = new COM ("SongsDB.SDBApplication") or die ("Cannot create MediaMonkey SDB Object");
Obviously you have to have PHP installed on a windows box to get that working. You can either run that using the php cli executable, or via a webserver if that is your preference. Once you have the COM object created it is pretty much the same as accessing via vbscript, except obviously using PHP object calling syntax:

Code: Select all

	//Get Album List
	$strSQL = "SELECT * FROM Albums";
	$objIter = $objSDB->Database->OpenSQL($strSQL);
It theoretically should also be possible to use the Activescript SAPI that comes with PHP on windows to get PHP to within the MM scriptlet control. I couldn't get it to work though, and there are questions about security if you register that DLL on your system. (i.e. it would be possible for a malicious website to host PHP code that would be run client side with no sandbox!)

by Peke » Wed Jan 12, 2005 9:44 pm

I would like to see some examples in PHP that utilize MM, and sorry if I'll be lame but I'm curious: Is there any way to use COM in PHP? and If can what is needed to comply this?

In delphi it will look like this:

Code: Select all

var
  SDB : Variant;
begin
  SDB := CreateObject('SongsDB.SDBApplication');
After that SDB acts like in vbscript that uses MM. is there any chance to use something like that in PHP?

by parkint » Wed Jan 12, 2005 1:20 pm

The COM object works brilliantly for scripting. I personally prefer PHP, and so use that almost exclusively to automate MM.

by Peke » Tue Jan 11, 2005 9:22 pm

Mediamonkeys COM Object can be used to colaborate with any Languge and it has same functions as Scripting (http://www.mediamonkey.com/developers.htm) See for help on scripting and use it for COMObj in perl.

Limits to scripting

by graham » Tue Jan 11, 2005 6:24 pm

Am I correct in saying that MM scripting (even in the up-coming beta release) excludes direct interaction with the MP3 / WMA files. Also even wit the new device specific plugin's you will not be able to manage file transfers etc onto your portable device?

So - assuming other languages (like Perl) allow you to do these things - can they be used instead?
Graham

Top