Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Join Date
    May 2006
    Posts
    5,380

    Script: Extract Zip From Dialogs

    this function will extract the contents of a zip file, it will frist ask the user for the location of the zip archive then will ask for the location of the folder to exrtract to

    there is error checking in the code so if any error occurs then the user is informed

    this script is stand alone ie: it dosent need any objects to function

    copy n paste this code into your project or download the lua attached to this post


    PHP Code:
    function OpenZip()
        -- 
    get the location of the zip archive
        GetFile 
    Dialog.FileBrowse(true"Locate Zip File"_DesktopFolder"All Files (*.*)|*.*|""""dat"falsefalse);
        -- 
    check that cancel wasent clicked, if it was exit the script
        
    if GetFile[1] == "CANCEL" then
        Application
    .ExitScript();
        else
        -- 
    get the folder to extract to    
        GetFolder 
    Dialog.FolderBrowse("Please select a folder to extract to:"_DesktopFolder);
            -- 
    check that cancel wasent clicked, if it was exit the script
            
    if GetFolder == "CANCEL" then
            Application
    .ExitScript();
            else
            -- 
    extract the archive
            Zip
    .Extract(GetFile[1], {"*.*"}, GetFoldertruetrue""ZIP_OVERWRITE_NEVERnil);
            -- 
    check that there was no error, if there was inform the user
            err 
    Application.GetLastError();
                if (
    err ~= 0then
                    Dialog
    .Message("Error"_tblErrorMessages[error], MB_OKMB_ICONEXCLAMATION);
                
    end
            end
        end
    end 
    -- call the function
    OpenZip(); 
    Open your eyes to Narcissism, Don't let her destroy your life!!

  2. #2
    Join Date
    May 2006
    Posts
    5,380

    doh!!

    i forgot to attach the file

    here it is
    Last edited by RizlaUK; 02-01-2009 at 11:35 AM.
    Open your eyes to Narcissism, Don't let her destroy your life!!

  3. #3
    Join Date
    Apr 2008
    Posts
    1
    looks great, but will this work for rars?

  4. #4
    Join Date
    Jun 2001
    Location
    California
    Posts
    2,014
    Nice job Rizla

  5. #5
    Join Date
    May 2006
    Posts
    5,380
    looks great, but will this work for rars?
    RAR'S ??, have you read the AMS documentation
    Open your eyes to Narcissism, Don't let her destroy your life!!

  6. #6
    Join Date
    Sep 2010
    Posts
    11
    hi
    can i cancel extract
    Zip.Extract(GetFile[1], {"*.*"}, GetFolder, true, true, "", ZIP_OVERWRITE_NEVER, nil);

Similar Threads

  1. Browse for zip to extract.
    By soso in forum AutoPlay Media Studio 6.0
    Replies: 6
    Last Post: 08-10-2008, 11:14 AM
  2. Script: Make Zip From Dialogs
    By RizlaUK in forum AutoPlay Media Studio 7.5 Examples
    Replies: 0
    Last Post: 03-15-2007, 06:25 PM
  3. gradient progress with zip extract
    By odracir in forum AutoPlay Media Studio 6.0
    Replies: 0
    Last Post: 12-25-2006, 04:33 AM
  4. extract my zip to the current folder
    By Wonderboy in forum AutoPlay Media Studio 5.0
    Replies: 10
    Last Post: 04-26-2005, 10:23 AM
  5. How can I know the FS Command name of a movie???
    By yoske in forum AutoPlay Media Studio 5.0
    Replies: 27
    Last Post: 01-01-2005, 10:39 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