Bio-formats importer, images title contain whole directory path sequence

Dear all,
I am running with my macro the Bio-formats importer, but when my images open they contain, instead of only the name of the file, the whole directory path (C:/user/…).
I just want the name of the file. How I can indicate Fiji to avoid typing the whole directory path?
Thanks

I’m not sure what all of these are exactly but check your configuration, I wonder if index is on and if that is full path name

%s: series index
%n: series name
%c: channel index
%w: channel name
%z: Z index
%t: T index
%A: acquisition timestamp

https://docs.openmicroscopy.org/bio-formats/6.4.0/users/imagej/options.html

Does not work, I tried to changed them.

No problem Looks like I stumbled on your cross linked post. I went to go find this post to respond to your other one.

So first, when I use the macro recorder to open a file on my machine, I am not seeing the square brackets after open= in the commend you typed originally, what happens if you remove these?

If that doesn’t solve the problem let me try to walk you through this code
The first line defines a variable for the directory of files you are looking at
dir1=getDirectory();

This line makes a variable “list” that is a list of all the files in the directory you pointed to
list=getFileList(dir1)

Then you tell the computer with what is called a “for loop” to do something one at time for as long as a condition is true. In this case, for each file in the list
for (f=0; f<list.length; f++) {

Now we combine the directory and file to get the fill path name and make this a variable
path = dir1+list[f];

Now open the file using bioformats importer
run(“Bio-Formats Importer”, “open=[path] autoscale color_mode=Composite split_channels view=Hyperstack stack_order=XYCZT series_”+s);

If at this point, hopefully it works, with just the file name but if its still the entire path, I can try to walk you through renaming it

you could add other code here if needed
then you need to close the for loop
}

Let me know if that isn’t clear and I’ll try again

Many thanks for all the explanations, know is super clear. I appreciate you took the time to explain it. I will try it now.