Dropped on the drop panel
Runs the macro when files, pictures, folders, text or links are dropped on its tile in the drop panel, the column of targets that slides out when you drag something to the edge of the screen.
Files are dropped on the drop panel
Details #
Every macro with a drop trigger is a tile in the drop panel. Start dragging a file, a picture, a folder, some text or a link from any app and push the pointer to the edge of the screen (the right edge unless Settings says otherwise), or shake the pointer left and right three times. A column of tiles slides out: the Shelf first, then your drop targets. Drop on one and its macro runs with what you dropped. You can also drag onto Switchboard's menu bar icon to open the same panel there.
accepts says what the tile takes: files, images, folders, text and urls. A picture file is both a file and an image, so a tile that takes files also takes a PNG. extensions narrows files and pictures to certain endings (["pdf"], ["jpg", "png"]). A tile shows only when everything being dragged is something it takes, so a Resize tile never appears with a ZIP in the drag. Left out, accepts is files.
A tile also needs its macro to be on, in a group that is on and in scope for the app in front, and to pass its Only if. Otherwise it isn't offered. The panel shows up to ten tiles, the group named Drop targets first and then the ones you drop on most.
What arrives:
{{dropped}}is the list of what was dropped: file, folder and picture paths, the text itself, or the links.{{dropped.first}}is the first,{{dropped.last}}the last and{{dropped.length}}how many. Go through them with a Repeat step set to for eachpindropped.{{triggerValue}}is the same list.A picture dragged out of a web page or another app that has no file is saved as a PNG first (in
~/Library/Caches/Switchboard), anddroppedholds that path.Files from an app that hands them over only when you drop (Photos, Mail attachments) are received into a temporary folder before the macro runs, and
droppedholds those paths.
Parameters #
| Parameter | Type | Required | Values | What it does |
|---|---|---|---|---|
accepts | list of | files images folders text urls | A list of files, images, folders, text and urls. If left out, files is used. | |
extensions | list of text | A list of file endings (pdf, png; with or without a dot, any case). Only files and pictures are held to it. If left out, any ending is taken. |
Every trigger also takes Limits: a cooldown, the first time each day, every nth time, twice within seconds, a chance, only while you are at the Mac, on one Mac, or in a State. See Limits on any trigger.
Examples #
- Files or folders are dropped on the drop panel
- Repeat for each p in dropped
- Move “{{p}}” to “~/Projects”
- Show “Moved {{length(dropped)}} item(s) to Projects”
- Files or folders are dropped on the drop panel
- Copy “{{join(dropped, "\n")}}” to the clipboard
- Show “Copied {{length(dropped)}} path(s)”
Gotchas #
The pointer must rest within 2 points of the edge for a moment (a screen edge that touches another display doesn't count). Shaking works anywhere. Esc closes the panel for the rest of that drag.
A drag that picks up nothing, such as selecting text or moving a window, never opens the panel.
Text and links dropped on a tile arrive as strings in
dropped; a file step given one will fail, so give such a tileaccepts: ["text"]or["urls"]and use text steps.Settings › Drop Shelf turns the edge, the shake and the menu bar drop on and off, and says how long the shelf keeps what is on it.