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