

This is why we can use the command above to tell whether a file is received by AirDrop. sharingd is the daemon responsible for handling AirDrop on macOS, and it attaches this attribute with its own name in it to every file it receives. In this case, is the xattr containing the quarantine level of a file and where it comes from. The extended attributes (xattr) are extra metadata attached to files for various management purposes. If so we echo it, giving it to the next action to move, otherwise we ignore it. For each file, we check its extended attribute with xattr and see whether "sharingd" is contained in it. With "Pass input:" on the top right corner of the action as "as arguments", the for loop goes through each file. The shell script inside the "Run Shell Script" action needs a bit more explanation. I have added a new folder called "AirDrop" inside my Download folder for this purpose.

It is similar to Shortcuts (originally Workflow) on iOS, but much older. Automator is a graphical programming environment specifically for macOS applications. We can achieve this using a Folder Action combined with some filtering thanks to a security feature provided by Apple.Ī Folder Action is an Automator workflow which runs whenever a file is added to a folder. But there is a workaround, that is moving the file received by AirDrop from Download to your desired destination automatically as it is received.
