Hello all,
I want to script the opening of a file. Exactly the same as File->Open except that I want to limit the user to see only certain file types. I can create the file open dialog as follows:
====================================================
var outputFilePathOrig = ShowOpenFileDialog("AVI Files (*.avi)|*.avi", "AVI File", "init file");
function ShowOpenFileDialog(filter, title, defaultFilename) {
var openFileDialog = new OpenFileDialog();
if (null == filter) {
filter = "All Files (*.*)|*.*";
}
openFileDialog.Filter = filter;
if (null != title)
openFileDialog.Title = title;
openFileDialog.CheckPathExists = true;
openFileDialog.AddExtension = true;
if (null != defaultFilename) {
var initialDir = Path.GetDirectoryName(defaultFilename);
if (Directory.Exists(initialDir)) {
openFileDialog.InitialDirectory = initialDir;
}
openFileDialog.DefaultExt = Path.GetExtension(defaultFilename);
openFileDialog.FileName = Path.GetFileName(defaultFilename);
}
if (System.Windows.Forms.DialogResult.OK == openFileDialog.ShowDialog()) {
return Path.GetFullPath(openFileDialog.FileName);
} else {
return null;
}
}
====================================================
but do not know how to use the file name (outputFilePathOrig ) that Ive obtained to actually open teh file in Vegas. Is this possible?
Thanks
Richard
I want to script the opening of a file. Exactly the same as File->Open except that I want to limit the user to see only certain file types. I can create the file open dialog as follows:
====================================================
var outputFilePathOrig = ShowOpenFileDialog("AVI Files (*.avi)|*.avi", "AVI File", "init file");
function ShowOpenFileDialog(filter, title, defaultFilename) {
var openFileDialog = new OpenFileDialog();
if (null == filter) {
filter = "All Files (*.*)|*.*";
}
openFileDialog.Filter = filter;
if (null != title)
openFileDialog.Title = title;
openFileDialog.CheckPathExists = true;
openFileDialog.AddExtension = true;
if (null != defaultFilename) {
var initialDir = Path.GetDirectoryName(defaultFilename);
if (Directory.Exists(initialDir)) {
openFileDialog.InitialDirectory = initialDir;
}
openFileDialog.DefaultExt = Path.GetExtension(defaultFilename);
openFileDialog.FileName = Path.GetFileName(defaultFilename);
}
if (System.Windows.Forms.DialogResult.OK == openFileDialog.ShowDialog()) {
return Path.GetFullPath(openFileDialog.FileName);
} else {
return null;
}
}
====================================================
but do not know how to use the file name (outputFilePathOrig ) that Ive obtained to actually open teh file in Vegas. Is this possible?
Thanks
Richard