3 Replies Latest reply: Sep 6, 2009 10:46 AM by Camelot
buddamint Level 1 Level 1 (0 points)
howdy.

how do you open an encrypted .zip file with an AppleScript ?

mac pro, Mac OS X (10.4.11)
  • iMad Richard Level 1 Level 1 (145 points)
    Finder does it automatically.

    tell application "Finder"
    open (choose file)
    end tell

    or

    tell application "Finder"
    open Macintosh HD:Path:To:Your:File.extension.zip
    end tell

    or

    tell application "Finder"
    open variable1
    end tell

    Or do you mean a zip that's encrypted?
  • buddamint Level 1 Level 1 (0 points)
    Thanks.


    "Or do you mean a zip that's encrypted?"


    Yes.
    How would you enter the password for an encrypted .zip ?
  • Camelot Level 8 Level 8 (46,440 points)
    How would you enter the password for an encrypted .zip ?


    The best you can get is to prompt the user for the password within your script, then pass that to the command line unzip, e.g.:

    set theZipFile to (choose file with prompt "Please select the zip file:")
    set thePW to text returned of display dialog "Please enter the zip file's password:" default answer "" with hidden answer

    do shell script "/usr/bin/unzip -P " & quoted form of thePW & space & quoted form of POSIX path of theZipFile