@echo off if /I "%1"=="/d" (echo on & shift) ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: :: INDEX v0.4.1 Ard Haskell UPDATE: 27FEB2004 :: :: Creates an HTML index of music albums. :: Index expects the following: MUSIC_FOLDER\ARTIST_FOLDER\ALBUM_FOLDER :: :: Dependent on: Now.exe (Windows resource kit) :: :: If you want extra info on the album, look up the ASIN (Amazon.com ID# of the album), :: and save it in the album folder by creating a new text file and calling it [ASIN].aml :: Example: U2\Pop's ASIN=B000001EAQ , so save a blank text file called B000001EAQ.aml in the album folder. :: :: Extra info with the ASIN present will be an "Info" link pointing to Amazon's page of that album (default) :: If A_IMAGES=ON a thumbnail image of the cover of the album will be displayed instead of "Info", with the :: prerequisite that the system in use is online at the time. :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :A_CONFIG set A_TITLE=Ard's Music Library set A_OUT=B:\aml.html set A_MUSIC=B:\Music set A_TEMP=C:\Temp :A_SETTINGS set A_ARTIST_COLOR=#888888 set A_BODY_COLOR=#B0C4DE set A_HEAD_TEXT_COLOR=#CCCCCC set A_TABLE_0=table bgcolor=#FFFFFF width=800 align=center border=0 cellpadding=0 cellspacing=0 set A_TABLE_1=table bgcolor=#000066 width=800 align=center border=0 cellpadding=0 :: Alternating colors set A_C0=#EEEEEE set A_C1=#FFFFFF :: Amazon cover thumbnails (experimental) set A_IMAGES=OFF ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :A_INIT color 0A & title %A_TITLE% - INDEX if not exist %A_TEMP% (md %A_TEMP%) if not exist %A_MUSIC% (echo ERROR: Music folder does not exist & echo Please create or select a different folder.) :: COUNT_0=New Paragraph Holder, COUNT_1=Album Counter, COUNT_3=Line color counter set A_VAR_0=0 set A_COUNT_1=0 set A_COUNT_2=0 set A_ARTIST_0=. set A_HEADER=%A_TEMP%\header.aml set A_BODY=%A_TEMP%\body.aml set A_FOOTER=%A_TEMP%\footer.aml set A_INDEX=%A_TEMP%\index.aml set A_AMAZON_URL=http://www.amazon.com/o/ASIN set A_AMAZON_IMAGE=http://images.amazon.com/images/P :A_MAIN call :A_INDEX_1 call :A_BODY call :A_HEAD call :A_INDEX_2 call :A_KILLER_ADD_FOOTER call :A_MERGER goto :A_END :A_HEAD echo ^^^%A_TITLE%^^ >%A_HEADER% echo ^^ >>%A_HEADER% echo ^<%A_TABLE_1%^> >>%A_HEADER% echo ^^^^%A_TITLE%^^^^ >>%A_HEADER% for /f "tokens=*" %%i in ('now') do echo ^^^^As of %%i^^^^ >>%A_HEADER% echo ^^^^%A_COUNT_1% Albums^^^^ >>%A_HEADER% echo ^^^ ^^ >>%A_HEADER% echo ^ >>%A_HEADER% goto :EOF :A_BODY echo ^<%A_TABLE_0%^>^^^^^ >>%A_BODY% for /f "tokens=3,4,5 delims=\" %%a in ('dir /b/s %A_MUSIC%\*.aml') do for /f "tokens=1 delims=." %%d in ("%%c") do set A_ARTIST_1=%%a & set A_ALBUM=%%b & set A_ASIN=%%d & call :A_PARSE & set /a A_COUNT_1+=1 echo ^^^^^^ >>%A_BODY% goto :EOF :A_INDEX_1 echo ^<%A_TABLE_0%^> >>%A_INDEX% echo ^^:: ^TOP^ ::>>%A_INDEX% goto :EOF :A_INDEX_2 echo ^^^ >>%A_INDEX% goto :EOF :A_PARSE if /I not "%A_VAR_0%"=="%A_ARTIST_1:~,1%" ( call :A_NEW_PARAGRAPH call :A_PRINT ) else ( call :A_PRINT ) goto :EOF :A_NEW_PARAGRAPH :: Creates new paragraph heading, when artist's first letter changes. set A_BGCOLOR=%A_C1% set A_VAR_0=%A_ARTIST_1:~,1% echo ^^^^^ >>%A_BODY% echo ^^^^^^ >>%A_BODY% echo ^^^^%A_VAR_0%^^^^ >>%A_BODY% echo ^^^^TOP^^^^ >>%A_BODY% echo ^%A_VAR_0%^ :: >>%A_INDEX% goto :EOF :A_PRINT ::Sets the line background color. if "%A_BGCOLOR%"=="%A_C0%" ( set A_BGCOLOR=%A_C1% ) else ( set A_BGCOLOR=%A_C0% ) ::Sets a repeating artists name in A_ARTIST_COLOR. if /I "%A_ARTIST_0%"=="%A_ARTIST_1%" ( echo ^^^"%A_ARTIST_1%%A_ALBUM%"^^ >>%A_BODY% ) else ( set A_ARTIST_0=%A_ARTIST_1% echo ^^^"%A_ARTIST_1%%A_ALBUM%"^^ >>%A_BODY% ) ::Set Amazon link, if aml-file is from Amazon database. if /I "%A_ASIN:~,1%"=="B" ( if /I "%A_IMAGES%"=="ON" ( echo ^^^^^^ >>%A_BODY% ) else ( echo ^^Info^ ^^^ >>%A_BODY% ) ) else ( echo ^^ ^^ >>%A_BODY% ) goto :EOF :A_KILLER_ADD_FOOTER echo ^<%A_TABLE_1%^> >>%A_FOOTER% echo ^^^ ^^^ >>%A_FOOTER% echo ^^^ >>%A_FOOTER% :: Geocities Addvertisement circumvention below. echo ^^