View Single Post
Old 26th March 2006, 19:13   #360
breakhead
Junior Member
 
Join Date: Mar 2006
Posts: 3
whilst im in the mood, another quick one. displays all images in folders from selected items. little bug that if u have an item from folder1, then an item from folder2, then an item from folder1 again it will display folder1's images twice (as the view nfo script does) - have to shoot now so if u want to use it fix it yourself!

Quote:
x = playlist.getselection

for i = 1 to ubound(x)
n = ""
d = split(x(i).filename,"\")
if ubound(d) > -1 Then
for s = 0 to ubound(d)-1
n = n + d(s) + "\"
next
end if
if n <> lastn then
set ofs = createobject("scripting.filesystemobject")
nf = locatefilesbyext(n,"jpg")
if ubound(nf) > 0 then
set ie = startIE(360,550)
ie.document.title = "IMAGES: " & n
ie.document.body.style.backgroundColor = "white"
ie.document.body.style.margin = 0
ie.document.body.style.textAlign = "center"
for each file in nf
if len(file) <> 0 then
set img = ie.document.createelement("IMG")
img.src = file
img.height = img.height / (img.width / 320)
img.width = 320
img.style.margin = 3
img.style.border = "1px dashed silver"
ie.document.body.appendChild(img)
end if
next
ie.visible = true
ie.document.body.focus()
end if
lastn = n
end if
set ie = nothing
set ofs = nothing
next

function locateFilesByExt(sFolder,sExt)
dim files
set d = ofs.GetFolder(sFolder)
for each f in d.files
name = f.name
aext = split(name,".")
if ubound(aext) <> -1 then ext = aext(ubound(aext))
if ucase(ext) = ucase(sExt) then files = files & f.path & vbCrLf
next
if len(files) <> 0 then
locateFilesByExt = split(left(files,len(files)-1),vbcrlf)
else
locateFilesByExt = array()
end if
set d = nothing
end function

function startIE(width,height)
set ie = createobject("internetexplorer.application")
ie.addressbar = false
ie.menubar = false
ie.resizable = false
ie.statusbar = false
ie.toolbar = false
ie.width = width
ie.height = height
ie.navigate("about:blank")
set startIE = ie
end function
features you might like to add:

filename display
open full size image
set image as folder.jpg
search on web for new art

some thoughts on activewinamp:

do these scripts carry on running to recieve events? how can i exit a script?

could do some real nice stuff with xmlhttprequest
breakhead is offline   Reply With Quote