File tree Expand file tree Collapse file tree 1 file changed +18
-9
lines changed
Expand file tree Collapse file tree 1 file changed +18
-9
lines changed Original file line number Diff line number Diff line change 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
1111def 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" )
You can’t perform that action at this time.
0 commit comments