Hi,
I am trying to save an image stored on a CD to a Hard Drive, giving the user the option to "Save As".
can you help with the code, please.
Moiz
Professional Software Development Tools
Hi,
I am trying to save an image stored on a CD to a Hard Drive, giving the user the option to "Save As".
can you help with the code, please.
Moiz
hi, you could use a simple script like below, edit the path to your file (marked in red)
Code:tbFile = Dialog.FileBrowse(false, "Locate File", _DesktopFolder, "JPEG Files (*.jpg)|*.jpg|All Files (*.*)|*.*|", "", "dat", false, false); if tbFile[1] ~= "CANCEL" then File.Copy("C:\\path\\to\\your\\file.jpg", tbFile[1], true, true, false, true, nil); -- Test for error error = Application.GetLastError(); if (error ~= 0) then Dialog.Message("Error", _tblErrorMessages[error], MB_OK, MB_ICONEXCLAMATION); else Dialog.Message("Success", "The file was saved to:\r\n"..tbFile[1], MB_OK, MB_ICONINFORMATION); end end
Open your eyes to Narcissism, Don't let her destroy your life!!
This is working perfectly.
Thanks,
I am trying to default the name to save to the name of the file, using a variable, but it gives me an error as it expects a string:
fileName = ThumbList.GetItemInfo("Pic_tn", selected[1]);
tbFile = Dialog.FileBrowse(false, "Save File", _DesktopFolder, "JPEG Files (*.jpg)|*.jpg|All Files (*.*)|*.*|", fileName, "", false, false);
can you advise.
ThumbList.GetItemInfo returns a table
try it like this:
Code:tbInfo = ThumbList.GetItemInfo("Pic_tn", selected[1]); if tbInfo then tbFile = Dialog.FileBrowse(false, "Save File", _DesktopFolder, "JPEG Files (*.jpg)|*.jpg|All Files (*.*)|*.*|", tbInfo.fileName, "", false, false); end
Open your eyes to Narcissism, Don't let her destroy your life!!
Thank you for your help