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  

 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 "..&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.

Footnotes

[1File.openUrlAsString(url) - File Functions - http://rsb.info.nih.gov/ij/developer/macro/functions.html#F

[2List.getValue(), List.set() - List Functions - http://rsb.info.nih.gov/ij/developer/macro/functions.html#L

logoij ImageJ (http://rsb.info.nih.gov/ij/) 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 (wayne@codon.nih.gov), 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.Bio.Methods@free.fr
Image analysis tools in biology
and biochemistry using ImageJ