Duplicate...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Duplicate...

ved sharma-2
Hi all,

While an image is open, I run following code in a macro:

---------------
name = "image name.tif";
run("Duplicate...", "title="+name);
--------------

It duplicates the image but the title of the duplicated image is "image" and
not "image name.tif".

I was just wondering if I'm making any mistake?

Thanks in advance,

Ved
Reply | Threaded
Open this post in threaded view
|

Re: Duplicate...

lartaud marc
Hi
try with
-------
name = "image_name.tif";
run("Duplicate...", "title="+name);
-------
don t use special caractere in the name
marc

Ved Sharma a écrit :

> Hi all,
>
> While an image is open, I run following code in a macro:
>
> ---------------
> name = "image name.tif";
> run("Duplicate...", "title="+name);
> --------------
>
> It duplicates the image but the title of the duplicated image is "image" and
> not "image name.tif".
>
> I was just wondering if I'm making any mistake?
>
> Thanks in advance,
>
> Ved
>
>  
Reply | Threaded
Open this post in threaded view
|

Re: Duplicate...

Ingo Bartholomaeus
In reply to this post by ved sharma-2
Hi Ved,

if you want to maintain space characters use:

name = "image name.tif";
run("Duplicate...", "title=&name");

> Requires IJ 1.43


or


name = "image name.tif";
run("Duplicate...", "title=["+name+"]);

> Earlier IJ versions


Best regards,
Ingo


-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of Ved Sharma
Sent: Mittwoch, 16. Dezember 2009 05:35
To: [hidden email]
Subject: Duplicate...

Hi all,

While an image is open, I run following code in a macro:

---------------
name = "image name.tif";
run("Duplicate...", "title="+name);
--------------

It duplicates the image but the title of the duplicated image is "image" and
not "image name.tif".

I was just wondering if I'm making any mistake?

Thanks in advance,

Ved
Reply | Threaded
Open this post in threaded view
|

Re: Duplicate...

Gabriel Lapointe-2
> name = "image name.tif";
> run("Duplicate...", "title=["+name+"]);
>
It might not work since there is a " missing

run("Duplicate...", "title=["+name+"]");

Gabriel
Reply | Threaded
Open this post in threaded view
|

Re: Duplicate...

ved sharma-2
In reply to this post by ved sharma-2
Thanks Ingo and Gabriel. It works!

Ved