Calling All HTML Scripting Experts

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: Calling All HTML Scripting Experts

by Plethora » Sun Jun 27, 2004 11:33 am

:P
Here's some script:
This may be new to some, old to others

Code: Select all

Dim NowString
NowString = UCase(Left(artistname, 1))
Left(artistname, 1) takes the first character from the left of artistname

Ucase(artistname) takes all lower case letters in artistname and
makes them uppercase, doesn't affect non letters.

So
NowString = UCase(Left(artistname, 1))
Takes the first character in artistname, makes it upper case, and sets NowString equal to it.

Hope this helps if you need something like this.
:D

NOOOOOOO!!!!!

by Plethora » Fri Jun 25, 2004 9:57 am

:cry: :cry: :cry:
Not my AlbumArtist node...
:cry: :cry: :cry:

:P Can't wait till 2.3 you guys and gals keep up the good work!!!

I'm currently working on a script in MM that will create web pages that display artist, album and tracks on each .htm it's an extensive script but fun to tinker with. :wink:

by jiri » Fri Jun 25, 2004 6:54 am

Unfortunatelly AlbumArtist field was forgetten and isn't included in scripting for MM 2.2. I'll make sure it's included in the next release (alpha to be released fairly soon), so far you could modify it directly in DB if needed.

Jiri

Web Site Galore

by Plethora » Thu Jun 24, 2004 9:48 pm

Ok,

I need to know what MM calls the AlbumArtist so I can access it in scripting. Maybe I am blind but I can't find it anywhere... I have tried looking at the scripting help reference page but I am still lost...

Thanks...

by Plethora » Wed Jun 23, 2004 8:50 pm

In the main window of MM (where you select tracks) there is a bar that has stuff like "album|track|artist|bitrate" and much more. I have discovered that if you right click on the bar you can select/deselect more sorting columns. One in paticular that I have started using is the "AlbumArtist" tab. I have these settings:

Artist = Artist or group that is actually performing
Album= Name of album
AlbumArtist= the core artist that I sort by

For example....
AlbumArtist = Dave Matthews
Artist = Dave Matthews Band
Album = Remember Two Things

Since Dave has his self titled CD's and some with other guests like Tim Reynolds, It's easier for me to sort.

Now it seems to me that the names or functions of these tabs (AlbumArtist and Artist) should be swapped, just for making more since.
I also warn you to becareful to only change the AlbumArtist if you like this idea. It seems that if you edit the Artist, then the AlbumArtist mirrors the change.

I believe what I have said, to be essentially correct.

On another note can anyone tell me what the itm.? is for the AlbumArtist tag in MM for scripting purposes? I'm having a hard time finding it...
Thanks

Ahhhh Yess

by Plethora » Wed Jun 23, 2004 8:33 pm

Ok kool, I did go there once before. It is a good resource for all things Microsoft :lol:

I'll continue my search there. :D

by jiri » Wed Jun 23, 2004 4:44 pm

Use fso.CreateFolder for this. I would recommend you to download scripting help from http://www.microsoft.com/scripting, you'll find many answers to your questions there.

Jiri

Yummy Scripting

by Plethora » Wed Jun 23, 2004 4:13 pm

Ok so those of you who have the extra time to script and like tinkering,
here's a tasty morsel to digest.

Code: Select all

artistfile = ""&savedir&""&artistname&".htm"
Set fsoartist = CreateObject("Scripting.FileSystemObject")
Set foutartist = fsoartist.CreateTextFile( artistfile, True)
This is just a part of the script I am forever working on... I didn't know this before and with enough tinkering I found out that I can create files to write to using the above code.

Now... does anyone know how to create folders in VBS? :D

creating a .vbs file

by Guest » Tue Jun 22, 2004 6:34 am

I think you just open a new notepad document,
use it to write / paste script into.
Save it & then rename it with a .vbs extension

I hope this helps

Opening a new file to write to

by Plethora » Sun Jun 13, 2004 2:31 am

Can any one help me with opening a new file to write to in VBS?

I see where the export.vbs script does this but it's still not clear to me.

Thanks

by Plethora » Thu Jun 10, 2004 9:03 pm

The above code is what i have so far.

How would i go about creating an html file with "artistname".html as the file name

as you can see in the code I have attempted a make shift version of this idea.

any comments would be great.

-Plethora

by Guest » Thu Jun 10, 2004 8:59 pm

Got this so far

Code: Select all

' Iterate through the list and export all songs 
  Progress.MaxValue = list.count 
  Dim i, itm 
	
	' Declare prevartist in order to check for duplicates in for loop
	Dim prevartist  
	Dim j
	j=0		

	for i=0 to list.count-1 
		Set itm = list.Item(i) 
	
		' Call Artistname and put to file
		Dim artistname 
		artistname = MapXML(itm.ArtistName)
		
		if prevartist<>artistname then
			' Body of the table 
			fout.WriteLine "<tr><td align=center class=dark>"&i+1&"</TD><td align=Center style='border-bottom-width:0px'><a href='http://www."&artistname&".htm'>"&artistname&"</a></td>" 
			
			' Create the output file 
			'Dim ArtistHtml
			'artistnameHTML = artistname
			'Set ArtistHtml = fso.CreateTextFile( artistnameHTML)
			'	artistnameHTML.WriteLine "<html>"
			'	artistnameHTML.WriteLine ""&artistname&""
		end if
		
		prevartist=artistname
		
		Progress.Value = i+1 
		if Progress.Terminate then 
			Exit For 
		end if 
	next 

by Guest » Thu Jun 10, 2004 7:34 pm

think i figured part of my current problem out... will post when more acurate...

by Plethora » Thu Jun 10, 2004 4:07 pm

Can you give me an example that creates a html file using an itm.artistname?

also
What is the MapXML for in the following code

Code: Select all

artistname = MapXML(itm.ArtistName)
    if artistname="" then 
      artistname = "&" 
    end if 
If I take out all other subs in the Export.vbs file (leaving the beginning ones and the html sub) I get an error having to do with this MapXML thingy.

THanks

by jiri » Thu Jun 10, 2004 1:07 pm

Yes, generally speaking that's what you need to do. Of course, there are some other things to do, e.g. to add full path and '.htm' extension to the filename, etc., but I think it's pretty clear.

Jiri

Top