Login  Register

Open "file.*" from within Macro

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options Options
Embed post
Permalink
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Open "file.*" from within Macro

Barton, Robert
13 posts
I'd like my macro to be able to open either .dcm or .jpg files depending on
what is located in the folder.

The line I tried was:

open("C:\\Physics\\DMLC\\Test 7\\Test7.*");

Any ideas on making this work?

Thanks
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Open "file.*" from within Macro

Justin McGrath
72 posts
Something like

path = "C:\\Physics\\DMLC\\Test 7\\Test7"
if File.exists(path+".jpg") open(path+".jpg");
else if File.exists(path+".dcm") open (path+".dcm");
else {What do if there's no file}

Justin

On 8/15/07, Robert Barton <[hidden email]> wrote:

> I'd like my macro to be able to open either .dcm or .jpg files depending on
> what is located in the folder.
>
> The line I tried was:
>
> open("C:\\Physics\\DMLC\\Test 7\\Test7.*");
>
> Any ideas on making this work?
>
> Thanks
>