I’ve thrown together some code to build an HTML list of links to images in a folder but I’d like to modify it to create several HTML lists, each with only 20 items. Here’s what I have for getting the file names and building a list of HTML list items:
set theFolder to choose folder"
tell application "Finder"
set repeat_list to the name of every file of theFolder
set new_List to {}
repeat with an_item in repeat_list
set end of new_List to "<li><a href=\"images/full/" & an_item & "\"><img src=\"images/thumb/" & an_item & "\" alt=\"" & an_item & "\" /></a></li>" & return
end repeat
end tell
So, I think what I’d like to be able to do is somehow divide the list into smaller lists of 20 items each (assuming there are more than 20 items) as many times as necessary so I end up with a series of lists of 20 items each.
Suggestions anyone? Thanks.