Suppress Dialog with SavePICT

Hi,
I have a loop that loads data from a file then plots it up (via another routine).
Is there anyway to suppress the Save Diaglog box - I have to press return every time the graph is plotted.
Not sol bad if I have 10 to plot, but not a few hundred!

Everything works, the right folder is selected, the filename is right, just I have to confirm it.

Snippet of code with loop section
For (i=0;i<NOI;i+=1)
FolderName = "Number"
CurrentFile = text_wave[i]
FolderName = FolderName + num2str(i)
NewDataFolder/O/S $FolderName
    LoadWave/A=Wave/J/L={0,10,0,0,0} CurrentFile
    PlotMyData()
    String FileName = FolderName + ".png"
    SavePICT/O/E=-5/B=72/P=S_Path as FileName
    KillWindow Graph0
SetDataFolder Root:
Endfor


Thanks for all for your help,
Jason.
pczjrh wrote:
Is there anyway to suppress the Save Diaglog box - I have to press return every time the graph is plotted.


If I understand, you likely need to create the graph with its KILL flag set to something other than 0. I have substituted the Display command for your PlotMyData() function call. Instead, I would call a LayoutMyGraph() function after the Display. This keeps it clear exactly where you have created the graph that you later kill.

string FolderName, FileName
for (i=0;i<NOI;i+=1)
         CurrentFile = text_wave[i]
         sprintf FolderName, "Number%d", i
     sprintf FileName, "%s.png" FolderName
         SetDataFolder $FolderName
     LoadWave/A=Wave/J/L={0,10,0,0,0} CurrentFile
     Display/K=1 ... CurrentFile as "MyData"
         LayoutMyGraph()
     SavePICT/O/E=-5/B=72/P=S_Path as FileName
     KillWindow Graph0
         SetDataFolder root:
endfor


--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAHuntsville
Thanks for the suggestions. Those do help keep track of things.

The problem is the "Save Graphic As:" dialog box invoked by the SavePICT command.
I thought by providing both the path and filename that this would not appear, but it still does.
Like I said, everything is filled in ready to go, just I have to physically press the Return key.

The KillWindow command bypasses the graph recreation procedure and closes the window without complaint.

Cheers,
Jason.
The /P flag expects the name of an Igor symbolic path. For details, execute this:
DisplayHelpTopic "Symbolic Paths"


In your case you will be better off using a full path:
String fullPath = S_path + fileName
Print fullPath // For debugging only
SavePICT/O/E=-5/B=72 as fullPath

Dear all.

I am trying to save a series of graphs more than 5000 to make a movie on Igor64 for mac. Based on the above discussion, I wrote the code as,


pathName = "/Users/...../"
fileName = num2str(i)+".jpg"
fullPathName = pathName + fileName
SavePICT/O/E=-6 as fullPathName

But still I got a dialog box to confirm the file saving. Actually I tried various combinations of expressions to specify the absolute file path but I have failed to suppress the appearance of the dialog box.  Would someone save me from the hell of endless Return key pressing? 

Kaz

Your call has two problems:

  • You are not providing a full path, which would start with the drive letter, i.e., C: ...
  • You are not using acceptable path separators (I think). Please read more about this by executing:
DisplayHelpTopic "Path Separators"

 

On Macintosh a full path starts with a volume name and uses colon separators. For example, "hd:Users:Me:Test.jpg".

On Windows a full path starts with a drive letter or UNC name and uses colon separators. For example, "C:Users:Me:Test.jpg". You can use backslashes instead of colons but you must escape them. See the help topic mentioned by chozo above for details.

I recommend using a symbolic path rather than full paths. Execute this for details:

DisplayHelpTopic "Symbolic Paths"

 

 

Thank you very much for your pointed advice. 

 

(1) the full pathname should include a drive name

(2) path separator for mac is ":" instead of "/"

(3) special characters such as "space" can be used directly in the pathname 

    wrong: "Users/xxx/yyy\ yy/"

    correct: pathName = "Macintosh HD:Users:xxx:yyy yy:"

 

I could successfully create a series of graph files. 

I frequently use unix side of mac so I just "copy and paste" the file path from the terminal app to igor(pro), although I have written many codes on igor(pro). 

Many thanks again,

 

Kaz

FWIW, you can convert from a Posix path to an HFS path (using colons) using ParseFilePath:

String hfsPath = ParseFilePath(10, "/Applications/Utilities", "*", 0, 0)
Print hfsPath
  hd:Applications:Utilities

This requires Igor Pro 7.00 or later.

 

Dear hrodstein

Thank you for your advice. I never realized such a useful command.

Kaz