Skip to content

Commit 5fce71c

Browse files
committed
made improvements to Zip it! destination
1 parent 4752162 commit 5fce71c

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

Zip Files.dropzone

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,33 @@
22

33
# Dropzone Destination Info
44
# Name: Zip it!
5-
# Description: Zips up the dropped files or folders and save on your desktop.
5+
# Description: Zips up the dropped files or folders and places the zip file on the desktop.
66
# Handles: NSFilenamesPboardType
77
# Creator: Sergej Müller
88
# URL: http://ebiene.de
9-
# IconURL: http://download.ebiene.de/dropzone/zip-it/icon.png
9+
# IconURL: http://aptonic.com/destinations/icons/zip.png
1010

1111
def dragged
12-
$dz.begin("Collect data...")
13-
$dz.determinate(false)
14-
1512
output = `./CocoaDialog standard-inputbox --title "New ZIP File" --e --informative-text "Enter name for new zip file (minus extension):"`
16-
input = output.split("\n")[1]
1713

18-
filename = (input ? input : 'Archive') + '.zip'
14+
button, filename = output.split("\n")
15+
16+
if button == "2"
17+
$dz.finish("Cancelled")
18+
$dz.url(false)
19+
return
20+
end
21+
22+
if filename == nil
23+
$dz.finish("Invalid Filename")
24+
$dz.url(false)
25+
return
26+
end
27+
1928
desktop = ENV['HOME'] + '/Desktop'
2029

21-
zipfile = ZipFiles.zip($items, filename)
22-
system("zip -d #{zipfile} '__MACOSX*' '*.DS_Store'")
30+
zipfile = ZipFiles.zip($items, filename + ".zip")
31+
system("zip -d #{zipfile} '__MACOSX*' '*.DS_Store' >& /dev/null")
2332
Rsync.do_copy(zipfile.gsub(/ /, '\ '), desktop, true)
2433

2534
$dz.finish("ZIP created")

0 commit comments

Comments
 (0)