This is useful if you want to create an action with a similar purpose to an existing action but with some modifications. The other way you can develop a new action is by right clicking on an existing action in the grid and clicking 'Copy and Edit Script' - This will duplicate the underlying action bundle as a new action and open the duplicated action for editing. The dragged method is called by Dropzone when items are dragged onto your action and the clicked method is called when your action is clicked on in the grid. In the template action you will notice that two Ruby methods have been created for you. The purpose of each metadata option is described in the Action Metadata section. text ( "Here's some output which will be placed on the clipboard" ) end def clicked # This method gets called when a user clicks on your actionĪt the top of the file is the generated metadata. # If you don't want to place anything on the clipboard you should still call $dz.url(false) The below $dz.text line places text on the clipboard. finish ( "Task Complete" ) # You should always call $dz.url or $dz.text last in your script. percent ( 100 ) # The below line tells Dropzone to end with a notification center notification with the text "Task Complete" determinate ( true ) # Below lines tell Dropzone to update the progress bar display # Handles: Files # Creator: Your name # URL: # Events: Clicked, Dragged # KeyModifiers: Command, Option, Control, Shift # SkipConfig: No # RunsSandboxed: Yes # Version: 1.0 # MinDropzoneVersion: 4.0 def dragged puts $items. # Dropzone Action Info # Name: Custom Action # Description: Describes what your action will do. The generated Ruby template script is given below. The generated script file provides template code so you can easily get started. This will open your default text editor with the newly generated script file and add the action to your Dropzone grid. When you've chosen values appropriate for your action, click Create Action. The values entered here will be used to generate the metadata section at the top of the action.rb or action.py script. This will bring up the 'Develop Action' dialog shown below which allows you to configure your action: The easiest way to develop a new Dropzone 4 action is to click the white plus in the top left of the grid and choose the 'Develop Action.' item. Dropzone parses this metadata when you add the action. The action.rb or action.py file must have certain metadata at the top. The bundle can also optionally contain other resources such as Ruby or Python libraries or executables. It must contain either an action.rb script (for Ruby actions) or an action.py script (for Python actions) and also an icon.png file that contains the default icon for the action. There's a good hands-on introduction to the Ruby language here and an introduction to Python here.Ī Dropzone 4 action bundle is simply a directory with a. If you haven't coded in Ruby or Python before then it would be a good idea to learn a little of either of these languages before attempting to create a Dropzone action. Dropzone actions are developed in either Ruby or Python. The API outlined below describes how you can easily develop your own actions to use with Dropzone and then share these actions with others. The possible uses are limited only by your imagination.Ī Dropzone action also accepts a click event so when you click on it in the Dropzone grid it does something: for example the Finder Path action copies the currently selected item path in Finder to the clipboard. This might be uploading the dropped files to a web service, renaming the files, resizing images, zipping files etc. The general idea of a Dropzone action is that files or text will be dropped on the action and then the action will perform some useful function on the dropped items. Bundling Ruby gems along with your action.$dz.inputbox(title, prompt_text, field_name).Accessing OptionsNIB environment variables.The API documentation for Dropzone 4 is provided below. The zipped versions are better if you want to download only specific actions or need to provide a link to an action. This repository works in conjunction with the dropzone4-actions-zipped repository which contains zipped versions of these actions (auto updated nightly). All other untested actions from this repository can be installed from this page. You can quick install most of these actions from a list of featured actions on our website here. This repository contains a bunch of add-on actions that work with Dropzone 4.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |