- Description, p1
- Code, p2
Description:
This macro shows how to get a list of files from a web server directory using the "File.openUrlAsString(url)" macro function [1].
When the URL correponds to an HTML page, it returns the html code of the page. When the URL is a repertory, the server gives a minimum HTML code, allowing the browser to print a comprehensible structure of the objects contained in the repertory. This code looks like the sample below, obtained from the url of the toolsets ImageJ macros repertory (http://rsb.info.nih.gov/ij/macros/t...):
The macro gives a method to extract the names of macros between ">" and "< /a>" tags from the HTML code, and how to present them as a list using the "List Functions" macro functions [2].
Note: in some cases other servers abbreviate long names, cutting them and adding the suffix "..>" for example. In that case, the code should be adapted in order to extract the names from the first part of the "href" lines.