Gilles Carpentier Research Web Site: Computer Image Analysis
Image analysis tools in biology and biochemistry using ImageJ

Home > List Online Macros

List Online Macros

Monday 8 June 2009, by Gilles Carpentier

  Table of contents  


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 (

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 "..&gt" for example. In that case, the code should be adapted in order to extract the names from the first part of the "href" lines.


[1File.openUrlAsString(url) - File Functions -

[2List.getValue(), List.set() - List Functions -

logoij ImageJ ( is a public domain Java image processing program inspired by NIH Image for the Macintosh. It runs, either as an online applet or as a downloadable application, on any computer with a Java 1.1 or later virtual machine. Downloadable distributions are available for Windows, Mac OS, Mac OS X and Linux. The author, Wayne Rasband (, is at the Research Services Branch, National Institute of Mental Health, Bethesda, Maryland, USA.
Gilles Carpentier, Faculte des Sciences et Technologie,
Universite Paris Est Creteil Val-de-Marne, France.

Special thanks to Alessandra Albano for the English correction of these sites.
Computer Data Acquisition
for Biochemistry Practice Works
Image analysis tools in biology
and biochemistry using ImageJ