How do you unzip a file to a certain location? i know the
do shell script " "
How do you unzip a file to a certain location? i know the
do shell script " "
/usr/bin/ditto can do this
do shell script "/usr/bin/ditto -xk " & sourceZipArchive & space & DestinationDirectory
-x extracts
-k handles .zip archives
Thanks (for noobs, you’d need to do the following:)
set sourceZipArchive to ("change to your file name")
set DestinationDirectory to ("change to the location to unzip to")
.and the paths must be POSIX paths (slash separated)
Yep. Thank god, cause i couldn’t use : for the paths.
Also, you should use quoted form of to treat as literal any characters to which the shell usually assigns special meaning (most notably spaces, but also many other punctuation marks and control characters). The following is a script that incorporates quoted form of into the concatenation of the strings.
-- sourceZipArchive and DestinationDirectory must be "POSIX paths"
set sourceZipArchive to ("change to your file name")
set DestinationDirectory to ("change to the location to unzip to")
do shell script "/usr/bin/ditto -xk " & quoted form of sourceZipArchive & space & quoted form of DestinationDirectory