elicit user input to define save path
epiphenom
I would like to make the function below save all waves to a path I define without asking each time for the folder for each wave.
Thanks for your time.
Function SaveWavesFromCurrentDF(matchStr)
String matchStr
String list
list = Wavelist(matchstr,";","")
NewPath/O pathUserSelected, "C:Users"
Save/O/C/W/I/B /P= pathUserSelected list
End
Set the path to a folder for which you have write access. In my case "C:Users:Howard" works.
July 2, 2013 at 05:45 pm - Permalink
I don't want to remove the dialog box because I would like the user to choose where to save the waves. When I remove the I/ flag then the save location has to be prespecified in the script which I don't want, because it will change.
July 2, 2013 at 06:45 pm - Permalink
String matchStr
String list
list = Wavelist(matchstr,";","")
Variable numWaves = ItemsInList(list)
if (numWaves == 0)
Print "No waves matched"
return -1
endif
NewPath /O pathUserSelected // Let the user choose the path
if (V_flag != 0)
Print "Cancelled"
return -1 // User cancelled
endif
Save/O/C/W/B /P=pathUserSelected list
Printf "%d waves saved\r", numWaves
return 0 // Success
End
July 2, 2013 at 07:24 pm - Permalink
Thanks.
July 2, 2013 at 07:33 pm - Permalink