save data avoid dialog

Hi,

I am Ayelet . I am using the following function (CreateFolderInHomeFolder("data1:", "pathB")), to save waves in Igor binary data format using the built-in savedata function, however no matter what I do the open dialog is showing up, which is a problem for me as I would like to incorporate this function in a big loop simulation and I want the saving option to be automatic and not to stop and wait for ‘yes’ confirmation every loop step.

In the help of the savedata function, it is mentioned that if you use \o the dialog should not be initiated but it still does for me.

Could you please help me in how to save waves automatically in an efficient automatic way, I guesses I have a mistake somewhere or I am missing something in my script?

Thank you!

function: 

Function/S FullPathToHomeFolder()

    PathInfo home
    if (V_flag == 0)
        // The current experiment was never saved so there is no home folder
        return ""
    endif

    String path = S_path
    return path
End

//print CreateFolderInHomeFolder("data2:", "pathB")

Function CreateFolderInHomeFolder(folderName, symbolicPathName)
    String folderName               // Name of folder to be created
    String symbolicPathName     // Name to use for the symbolic path

    String fullPath = FullPathToHomeFolder()// retrive the home directory were the experiment is saved in to generate new subfolder at the same directory

    if (strlen(fullPath) == 0)
        return -1
    endif

    fullPath += folderName

    //create new symbolic Path :0
    NewPath/O/C $symbolicPathName, fullPath //The folder specified by "path" is created if it does not already exist->c.
    //SaveData /O/D=1/P=$symbolicPathName /J="aa"

    string wavelistN="aa;bb"
    SaveData /O/D=1/P=$symbolicPathName /J=wavelistN

    return 1                        // Success
End

 

You need to provide a file name to SaveData. See the documentation for SaveData.

The /P flag tells it wht folder to write to. The file name tells it what file to write to.