I could be wrong, but I don't think you're going to be able to get File
I/O access from a web plugin. IE (and most browsers) typically block
that even in trusted zones (or should). If you're wanting to write to
the file system you're probably going to have to write a full .Net
plugin to do it. If you're wanting to write it into another format than
the ToXML gives you it maybe possible to use a DataSet to easily get at
the XML (.Net also includes XML parsing libraries but the DataSet maybe
the easiest and quickest). See if this Url helps out, it includes both
C# and Vb.Net examples of using the DataSet to read XML (both document
with and without schemas):
http://msdn2.microsoft.com/en-us/library/fx29c3yd(VS.71).aspx
From: ymedev@yahoogroups.com [mailto:ymedev@yahoogroups.com] On Behalf
Of Alex S. Brown, PMP
Sent: Sunday, August 05, 2007 8:00 PM
To: ymedev@yahoogroups.com
Subject: [ymedev] Trying to Write Playlist Information to a Local File
from a Web Plug-In
I am trying to replicate one of the great features of the MusicMatch
software within YME, and I am running into a brick wall.
MusicMatch has the ability to export information about any playlist in
a variety of formats (text, XLS, etc.). Some formats have lots of
detail, some very little. YME does not seem to have that feature.
I saw the Excel plug-in, but it does not do everything that the old
MusicMatch exports would do, plus it relies on a pesky automation
interface to Excel. I am an OpenOffice user and would rather not rely
on Excel.
Here is the problem: I am writing a web plug-in, and I have the basic
playlist information loaded up and working. I can get the ToXML
function to work, and I can get specific columns of data about the
playlist.
My problem is that I cannot figure out how to write this great data
out to a file. It might be some kind of security setting for web-based
plug ins, but I cannot find a way to write a local file with the XML
or the playlist data in a tab-separated format. If there is no
workaround I might simply have the plug-in write the information to a
text box. I can always copy-and-paste from the text box into a text
editor, but that seems silly.
The techniques I have used so far include trying to create an ActiveX
File System Object using the following statement:
fso = new ActiveXObject("Scripting.FileSystemObject");
I get an error that it cannot create the ActiveX object.
I also tried using the built-in ExportPlaylist2 function, but it
always returns "false" (unable to complete the export).
Any ideas about what might work here? I thought the web plug-ins
operated in a "trusted" zone where we would have access to file I/O.
If not, I guess I will have to copy-and-paste or work on a DLL-based
plug-in.
--Alex
[Non-text portions of this message have been removed]