Limits to scripting

Download and get help for different MediaMonkey for Windows 4 Addons.

Moderators: Peke, Gurus

graham

Limits to scripting

Post by graham »

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
Peke
Posts: 18181
Joined: Tue Jun 10, 2003 7:21 pm
Location: Earth
Contact:

Post by Peke »

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.
Best regards,
Peke
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying
Image
Image
Image
How to attach PICTURE/SCREENSHOTS to forum posts
parkint
Posts: 16
Joined: Sat Oct 09, 2004 1:54 am

Post by parkint »

The COM object works brilliantly for scripting. I personally prefer PHP, and so use that almost exclusively to automate MM.
Peke
Posts: 18181
Joined: Tue Jun 10, 2003 7:21 pm
Location: Earth
Contact:

Post by Peke »

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?
Best regards,
Peke
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying
Image
Image
Image
How to attach PICTURE/SCREENSHOTS to forum posts
parkint
Posts: 16
Joined: Sat Oct 09, 2004 1:54 am

Post by parkint »

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!)
sadao
Posts: 191
Joined: Tue Nov 09, 2004 7:44 pm
Location: Arlington, VA

Post by sadao »

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?
Lowlander
Posts: 58332
Joined: Sat Sep 06, 2003 5:53 pm

Post by Lowlander »

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?
jiri
Posts: 5426
Joined: Tue Aug 14, 2001 7:00 pm
Location: Czech Republic
Contact:

Post by jiri »

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
Lowlander
Posts: 58332
Joined: Sat Sep 06, 2003 5:53 pm

Post by Lowlander »

Thx
Post Reply