|
|
applescript tool to make zip/bzip archives
the following applescript makes tar-bzip2 archives out of any selected folder. put it in your finder tool bar or add it to the action menu. select a folder and then click the tool.
you can modify it to make zip files too of course. But zip and bzip are not natively aware of HFS file resource forks/meta data. tell application "Finder"
try
activate
set frontWin to folder of front window as string
set frontWinPath to (get POSIX path of frontWin)
do shell script "perl -we '$x = \"" & frontWinPath &
"\"; die \"aborting: can not parse \n$x\n\" unless
$x =~ m(^(.*/)([^/]*)/$);$a = quotemeta($x);$d =
quotemeta($1);$t= quotemeta($2);$y = $t.\".tbz2\";die
\"aborting: source is not a folder\n$x\n\" unless
-d $1 and -d $x; die \"aborting: target exists\n
$y\n\" if -f \"$d/$y\";$command = \"cd $a/.. &&
tar --bzip2 -cf $y $t\"; exec $command '"
on error error_message
beep
display dialog error_message buttons ¬
{"OK"} default button 1
end try
activate
end tell
end run
IMPORTANT NOTE FROM THE EDITOR: I have seriously modified the above script so that it will display in a much narrower fashion. If you're using this script, you'll need to modify the do shell script... line. Remove every line break, replacing each with a single space. The end of the script is the line that starts with tar --bzip2....
|
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysNo new commentsLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.18 seconds |
|