save graph as tiff in procedure

Hi, I have problems figuring out the right way to use the SavePICT operation to save a graph as a tif. I tried different versions but none of them work. During compile the colon (:) between C and Users is marked and it says non-existant data folder. However I successfully used the same path with the ImageLoad operation (at the bottom).

Function savepic()

SavePICT /E=-7 /B=288 /P=C:Users:Admins:Desktop:test:Graph1.tif
//SavePICT /E=-7 /B=288 "C:Users:Admins:Desktop:test" as Graph1.tif
//SavePICT /E=-7 /B=288 C:Users:Admins:Desktop:test:Graph1.tif

//ImageLoad/T=tiff "C:Users:Admins:Desktop:test:test.tif"

End

Cheers,

Finn
finn wrote:
Hi, I have problems figuring out the right way to use the SavePICT operation to save a graph as a tif.


Here is a bit of code I use to save images to a folder with today's date
String filename = nameofwave(wave0)
String today =  Secs2Date(DateTime,-2)
NewPath/C/O/Q/Z savefolder,  "E:Analysis:" + today
String SaveFile = filename+".tif"
SavePict/E=-7/Res=576/P=savefolder/O/TRAN=1 as SaveFile


You can obviously change the "savefolder" or "filename" to whatever you would like.
You need as before the quoted file path.
SavePICT /E=-7 /B=288 as "C:Users:Admins:Desktop:test.tif"
finn wrote:

SavePICT /E=-7 /B=288 /P=C:Users:Admins:Desktop:test:Graph1.tif

The /P flag expects the name of a Path object made with NewPath or Misc->New Path.... Also, without having as "Graph1.tif" at the end, Igor would prompt you for the file name.
finn wrote:

//SavePICT /E=-7 /B=288 "C:Users:Admins:Desktop:test" as Graph1.tif

Igor doesn't know what to do with the string containing your path because it doesn't correspond to a parameter for SavePICT. You could use that string to make a NewPath. Also, the file name should be quoted.

The third version has combined problems from the first two.

I think it should work properly like this:
SavePICT /E=-7 /B=288 as "C:Users:Admins:Desktop:test:Graph1.tif"