1

(1 replies, posted in Dropzone Support)

Hello,

I've managed to create a simple screenshot plugin using the 'screencapture' command in OS X,

It's early days, but thought I'd share what's going on so far:

# Dropzone Action Info
# Name: Screenshots
# Description: Take a screenshot, add it to ~/Screenshots and add to Drop Bar
# Creator: Gareth Evans
# URL: http://yoursite.com
# Events: Clicked
# KeyModifiers: Command, Option, Control, Shift
# SkipConfig: No
# RunsSandboxed: No
# Version: 1.0
# MinDropzoneVersion: 3.0

def clicked
# Create the Screenshots directory if not already present
  system("mkdir ~/Screenshots")
# Capture screenshot.png to the directory
  system("screencapture -i ~/Screenshots/screenshot.png")
  file_paths = [File.expand_path('~') + "/Screenshots/screenshot.png"] 
  $dz.add_dropbar(file_paths)
# Notification
  $dz.finish("Screenshot successful")
  $dz.url(false)
end

My biggest hurdle is when you take a second screenshot, it looks like there are two files in the drop bar, but both icons point to the same screenshot.png,

Does anybody know if there is a dz.remove command in the API so I can put it above the dz.add command, ensuring there is only ever one icon in the Drop Bar.

Also, if there's an easier way to approach this I'm all ears smile

it's probably related to the fact apple removed the "secure empty trash" command from OS X, there were doubts about how secure it actually was:

https://discussions.apple.com/thread/7700258