INTERACT FORUM
Windows => Third Party Plug-ins, Programs, and Skins => Topic started by: Mr ChriZ on January 07, 2006, 08:21:46 am
-
This Plugin has been superseded by the .NET Script Plugin
http://yabb.jriver.com/interact/index.php?topic=38693.msg263177#msg263177
This thread is now Locked.
-
This is very cool!
I've installed it and it works with the sample code. I'll play with the automation commands this weekend. Maybe I'll be able to come up with a way to automate the photo workflow I use... It's sooo repetitive, it would be great if I could script most of it!
Thanks!
Michel.
-
Looking forward to it!
M.
-
Hi,
www.savefile.com seems to be down so I can't download the new version....
I tried pinging it but no response...
Michel.
UPDATE: It works now. I downloaded the file. :-)
M.
-
This is very good. Would be even better if I could write some scripts :)
-
Hi,
I've trying to download the file from this new site (mooload.com) and it's not working...
Mybe you could email me the file?
M.
-
Downloaded flawlessly!
M.
-
Installation was no problem on my notebook which had the .Net framework 2.0 but when I fired up MC 11.1109, it gave me a message that "Interface Plug-in 'C# Script Plugin" could not be found or created.
Went to the Plugin Manager and tried to uninstall the plugin to re-install but I got the same error message...
?
M.
-
This time the download, install and firing up of the plugin was perfect.
When running the script, i get this error:
"Compiling Script...
Failure Compiling Script :-
Unable to cast transparent proxy to type 'CSScriptLibrary.AsmRemoteBrowser'."
M.
-
You won't believe it...
"ezUpload.org is currently down for maintenance and upgrades, but will be back up shortly. Once we are back up, we will have an all new layout and more features. Please keep checking back for updates!
pyius @ ezUpload.org "
M.
-
That download site worked.
The plugin installed and ran perfectly. No problems at all this time.
M.
-
Mr ChriZ,
This is an extremely cool plugin. I just converted a few methods from the BusyBox example to see if they would work in the C# plugin and everything is smooth. I'm going to use it now to script a complicated rename job that I need to do on about 3,000 tracks.
This is great, great work, thanks!
How is the progress coming on the next version?
Is there a way to save and load scripts?
Here are the steps to try out the examples for anyone else who would like to use Chris' slick C# script plugin:
- Close MC
- Install C# script plugin.
- Open MC and click on C# Script Plugin in the Services & Plug-ins branch of the tree
- Click the green New Script button at the bottom of the main panel
- Replace the script text with the script below
- Comment/uncomment items in the init method
- Click the green Run Script button
// Quickie conversion of a few busybox methods to try out c# script
using System;
using System.Windows.Forms;
//css_reference MediaCenter.dll;
class Script
{
static public void Init(object MediaJukebox, object textBoxReference)
{
MediaJukebox.MJAutomation mediaCenterInterface = (MediaJukebox.MJAutomation)MediaJukebox;
System.Windows.Forms.TextBox outputTextBox = (System.Windows.Forms.TextBox)textBoxReference;
//Show a Sample Message Box Proving we are running!
//MessageBox.Show("I am a Running Script!");
outputTextBox.AppendText("\r\nThis script is running.");
//Set the Volume Of Media Center!
MediaJukebox.MJMixerAutomation MCMixer;
MCMixer = mediaCenterInterface.GetMJMixer();
//MCMixer.Volume = 50;
//ListPlaylists(mediaCenterInterface, outputTextBox);
//ListPlayingNow(mediaCenterInterface, outputTextBox);
PlayRandomTracks(mediaCenterInterface, outputTextBox);
}
static public void ListPlaylists(MediaJukebox.MJAutomation g_MJ, System.Windows.Forms.TextBox outputTextBox)
{
outputTextBox.AppendText("\r\n List Playlists");
// get the playlists collection
MediaJukebox.MJPlaylistsAutomation MJPlaylists = (MediaJukebox.MJPlaylistsAutomation) g_MJ.GetPlaylists();
// go through each playlist
for (int z = 0; z < MJPlaylists.GetNumberPlaylists() - 1; z++){
// get the playlist
MediaJukebox.MJPlaylistAutomation MJPlaylist = (MediaJukebox.MJPlaylistAutomation) MJPlaylists.GetPlaylist(z);
// get the playlist's full path
string strFullPath = MJPlaylist.Path;
if (strFullPath != "") {
strFullPath = strFullPath + "\\";
}
strFullPath = strFullPath + MJPlaylist.Name;
// add the playlist to the list
outputTextBox.AppendText("\r\n"+ strFullPath);
}
} // end ListPlayLists
static public void ListPlayingNow(MediaJukebox.MJAutomation g_MJ, System.Windows.Forms.TextBox outputTextBox)
{
// get the current playlist object
MediaJukebox.MJCurPlaylistAutomation MJCurPlaylist = (MediaJukebox.MJCurPlaylistAutomation) g_MJ.GetCurPlaylist();
// go through each file
for (int z = 0; z < MJCurPlaylist.GetNumberFiles() - 1; z++){
// get the file
MediaJukebox.MJFileAutomation MJFile = (MediaJukebox.MJFileAutomation)MJCurPlaylist.GetFile(z);
// add the file to the list
outputTextBox.AppendText("\r\n"+ MJFile.Filename);
}
} // end ListPlayingNow
static public void PlayRandomTracks(MediaJukebox.MJAutomation g_MJ, System.Windows.Forms.TextBox outputTextBox)
{
// get the current playlist object
MediaJukebox.MJCurPlaylistAutomation MJCurPlaylist = (MediaJukebox.MJCurPlaylistAutomation)g_MJ.GetCurPlaylist();
// remove all the existing tracks
MJCurPlaylist.RemoveAllFiles();
// add 10 random files
// get all the files in the library
MediaJukebox.MJFilesAutomation MJFiles = (MediaJukebox.MJFilesAutomation) g_MJ.Search("");
Random rand = new Random();
// go through and add 10 files
for (int z = 0; z < 10; z++){
// pick a random file
int nFileIndex = rand.Next(MJFiles.GetNumberFiles() );
// make sure the index is in bounds
if (nFileIndex >= 0 && nFileIndex < MJFiles.GetNumberFiles()) {
// get the file
MediaJukebox.MJFileAutomation MJFile = (MediaJukebox.MJFileAutomation)MJFiles.GetFile(nFileIndex);
// add it to playing now
MJCurPlaylist.AddFile(MJFile.Filename, z - 1);
}
}
// set the first file to play
MJCurPlaylist.Position = 0;
// start playback
MediaJukebox.MJPlaybackAutomation MJPlayback = (MediaJukebox.MJPlaybackAutomation) g_MJ.GetPlayback();
MJPlayback.Play();
// output status
outputTextBox.AppendText("\r\nPlaying random tracks from Media Library");
} // end PlayRandomTracks
} // end script class
-
Glad you like it! =)
And thanks for the example
Theoretically you shouldn't need to save/load,
unless you're working in a seperate editor.
As you type it saves. Next time you open Media Center
the scripts will be just as you left them.
If you choose to use a seperate editor as you set
the script editor back into focus it should notice the file has changed
(this maybe tempermental let me know!).
(You can see the script files in explorer by clicking Explore Scripts).
The only thing it won't do yet is notice if you add a file in the script directory. This is also on the cards.
I do intend to add a conventional save/load system eventually.
I'm afraid development is on hold for the time being.
I'm on the home straight of a computing degree which isn't leaving me
any time to do fun stuff like this! Come June I'll have alot more time. (Although I'm also gonna be out getting wrecked ;) )
I'm scraping half an hour a day at the moment to spend on my evillyrics plugin.
I also need to finish my Tabbed Web browser plugin. So at the moment
this isn't getting a lookin. I'll PM you next time I do a build however!
=)
-
Script was placed here for out of proc stuff,
this is now Resolved.
-
My Chriz,
I ran your script and I got an exception in the output text box...I think it may be your machine :D
Adam
-
Very nice plug-in.
I just got it going and tried your out of Proc attempt, no joy. Here is the error msg, I'm assuming you get the same:
System.Runtime.InteropServices.COMException (0x800401E3): Operation unavailable (Exception from HRESULT: 0x800401E3 (MK_E_UNAVAILABLE))
at System.Runtime.InteropServices.Marshal.GetActiveObject(Guid& rclsid, IntPtr reserved, Object& ppunk)
at System.Runtime.InteropServices.Marshal.GetActiveObject(String progID)
-
btw, the plug-in worked beautifully for the complicated rename job I mentioned earlier. I had about 3000 tracks that I needed to be fixed and I was able to do it in about an hour of scripting. Thanks again.
-
Props on the plugin ChriZ! I tried your code snippet, and it ran without exception.
As for feature requests.... Intellisense! (yeah, I'm a big .NET wuss).
-
Glad you like it.
Intellisense is on the cards, but I'm going to need to spend much
more time with #Develops code, because it's something
thats integrated more into the core of the program, unlike
the editor which just easily detatched =)
I've got more time to spend on these
projects now anyhow, so may get back to it soon :)
-
Been working on a new version of this today
which allows VB.NET scripts.
Unfortunatley the Scripting engine I'm using
doesn't quite seem to bend in the direction
i want it to at the moment.
It will run VB.NET scripts, but not as an
integrated library. Anyhow I've sent
about 6 emails off to the author, and hopefully
it will be resolved soon! :)
Maybe with Olegs help if I get the VB stuff
up and running, we can increase the number of users
from 4, up to who knows maybe 5 :)
-
The download links don't seem to be working.
Thanks.
-
I'll try sort this out tomorrow. These links timeout after 60 days.
This project kind of got neglected when I started on
Intention skin. Hopefully by the new year when that's released I can
come back to it and do an overhaul!
-
New link
uppit.com/2JJWK (http://uppit.com/2JJWK)
I can't say this is well tested.
I noticed there is a bug in the renaming of files.
Also it gets a bit funny with the working of MC12.
You need to make sure it's installed in the MC12 directory
rather than the MC11 directory.
I started on a replacement plugin called the .NET Script Plugin,
but it's only about 70% complete.
Hopefully will revisit it after xmas.
-
Great plugin. Thank you very much for doing this! Looking forward to new version.
Is it possible to use this to move my album art to the new directories?
Currently they are all located in one directory but i would like move them to
the same directories where the related music files are.
What kind of bug there is in the renaming of the files?
I'm planning to make a script that
1. reads each albums image filename
2. copies file to a new location.
then maybe
3. write image's file path back to the music file (maybe it's easier to do the quick find in MC)
-
Great plugin. Thank you very much for doing this! Looking forward to new version.
Thanks :) I really do intend to get back to it, it's one of my favourite projects.
Is it possible to use this to move my album art to the new directories?
Currently they are all located in one directory but i would like move them to
the same directories where the related music files are.
I don't see why not. Read the field that contains the current path,
then move them to a path of your choice using the fields of your choice.
What kind of bug there is in the renaming of the files?
Theres a textbox on each tab which shows the name of the script, you used to be
able to just edit this and it would rename the script, however this appears to have stopped working.
You can always rename the scripts in explorer, and then restart MC until it's fixed.
I'm planning to make a script that
1. reads each albums image filename
2. copies file to a new location.
then maybe
3. write image's file path back to the music file (maybe it's easier to do the quick find in MC)
Ah lol didn't read that bit, till last.
Great minds think alike! ;)
Give it a go.
If it works there's a post some linked at the top of this one
that contains sample scripts. Feel free to add to them!
If you need any help, just give a yell, and I'll see what I can do!
Some sample scripts are here
http://yabb.jriver.com/interact/index.php?topic=33020.0