abnrange
06-13-2009, 04:18 PM
Hello all,
I would like to have a few button that will save all the text from an input object and save with diffrent extension such as, bat, cfg & inf. The code below is what I'm currently using and works. I want to elimate the file browse and just save with the correct extension.
I have a drop down that populates 5 files with different extensions. I have 5 buttons that are hidden and show when the current text is populated. How can I change this code to save as the right extension with out the file browse. Hope this makes sense - Thanks
-- Prompt the user for a location to save to
sSaveFileName = Dialog.FileBrowse(false, "Save", "C:\\ZFDAGENT", "bat (.bat)|.bat|", "zfd.bat", "bat", false, false)[1];
-- Get the paragraph properties
tProperties = Input.GetProperties("Input1");
-- Get the currently displayed text
sText = tProperties.Text
-- Output the text to a file
TextFile.WriteFromString(sSaveFileName, sText, false);
I would like to have a few button that will save all the text from an input object and save with diffrent extension such as, bat, cfg & inf. The code below is what I'm currently using and works. I want to elimate the file browse and just save with the correct extension.
I have a drop down that populates 5 files with different extensions. I have 5 buttons that are hidden and show when the current text is populated. How can I change this code to save as the right extension with out the file browse. Hope this makes sense - Thanks
-- Prompt the user for a location to save to
sSaveFileName = Dialog.FileBrowse(false, "Save", "C:\\ZFDAGENT", "bat (.bat)|.bat|", "zfd.bat", "bat", false, false)[1];
-- Get the paragraph properties
tProperties = Input.GetProperties("Input1");
-- Get the currently displayed text
sText = tProperties.Text
-- Output the text to a file
TextFile.WriteFromString(sSaveFileName, sText, false);