Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 5 of 5

Thread: Save As

  1. #1
    Join Date
    Aug 2001
    Location
    UK
    Posts
    20

    Save As

    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

  2. #2
    Join Date
    May 2006
    Posts
    5,380
    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!!

  3. #3
    Join Date
    Aug 2001
    Location
    UK
    Posts
    20

    Save as

    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.

  4. #4
    Join Date
    May 2006
    Posts
    5,380
    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!!

  5. #5
    Join Date
    Aug 2001
    Location
    UK
    Posts
    20

    Save As

    Thank you for your help

Similar Threads

  1. help with save as
    By Dangerscott2020 in forum AutoPlay Media Studio 6.0
    Replies: 10
    Last Post: 07-05-2007, 12:38 AM
  2. click button to save file - opens up save window...
    By cityofsalisburync in forum AutoPlay Media Studio 5.0
    Replies: 0
    Last Post: 11-10-2006, 08:43 AM
  3. Save As Doesnt Save Anything
    By nigeldude in forum AutoPlay Media Studio 6.0
    Replies: 0
    Last Post: 05-19-2006, 02:03 AM
  4. Displaying a Save As Dialog
    By Desmond in forum AutoPlay Media Studio 5.0 Examples
    Replies: 0
    Last Post: 10-01-2003, 03:53 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts