Browse the docs

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 each p in dropped.

  • {{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), and dropped holds 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 dropped holds those paths.

Parameters #

ParameterTypeRequiredValuesWhat it does
acceptslist offiles images folders text urlsA list of files, images, folders, text and urls. If left out, files is used.
extensionslist of textA 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 #

Move dropped files into Projects (really moves them)
When
  1. Files or folders are dropped on the drop panel
Do
  1. Repeat for each p in dropped
  2. Move “{{p}}” to “~/Projects”
  3. Show “Moved {{length(dropped)}} item(s) to Projects”
Open in Switchboard to try it
Copy the paths of what you drop
When
  1. Files or folders are dropped on the drop panel
Do
  1. Copy “{{join(dropped, "\n")}}” to the clipboard
  2. Show “Copied {{length(dropped)}} path(s)”
Open in Switchboard to try it

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 tile accepts: ["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.

See also #

File or folder change, File operation, Repeat