Re: isOpen("path") ?

Posted by vischer on
URL: http://imagej.273.s1.nabble.com/isOpen-path-tp5002210p5002268.html

Thanks Johannes for your contribution. My mail was more a suggestion to accept paths in isOpen(string), and I had solved my problem already somehow, but I tried your macro and it worked as expected.

However, there is a basic problem as ImageJ in my opinion has no straight-forward concept to identify images and paths. It automatically can create duplicates which is confusing.

In Image>Show Info>, "title" and the end of "path" do not match after "Rename" or after loading the same image a second time. In the latter case, ImageJ opens a duplicate with a new name ("clown-1.tif") but still maintains the old path ending with "clown.tif".

Assume another case where "clown.tif" is on the dock - ImageJ will behave different depending on whether the clown was there as minimized window, or as file associated to ImageJ. In the latter case, each click creates a new duplicate.

When ImageJ chooses a new name for a duplicate, this name may already be occupied by a different file in the same folder, although this is not likely. The danger of unwanted overwriting is "solved" by warning "File already exists" before each attempt to "Save". (I routinely confirm without thinking).

It would be nice if ImageJ would behave like other applications:

- If the user gives any type of "Open" command to a file which is already open, its window should be brought to the front, rather than being duplicated with a different name. If it was edited meanwhile, the user should be asked which version to use.

- If the user gives a "Save" command and the path is known, the old file should be overwritten without additional confirmation

But may be it is to late to change all this?

Norbert
--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html