Open "file.*" from within Macro

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

Open "file.*" from within Macro

Barton, Robert
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
|

Re: Open "file.*" from within Macro

Justin McGrath
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
>