I like to save inspirational imagery in my dock. Since my Downloads folder is always a giant pile of files that I hoard and enjoy to go through every once in a while. Now to save space in my Dock I’d have to have a folder as a stack where all those aliases to inspirational files are stored in. It would be nifty to be able to drag files into that folder and have the folder automatically create an alias of the file instead of moving it to there. That way I wouldn’t have to use shortcuts etc. and could simply drag files into there without actually moving them.

Understood? Maybe someone knows a solution. I’m guessing an AppleScript would be required. Let’s work together on this to make it happen.

  • 1
    Possible duplicate of How to create an alias with drag and drop? – Allan Aug 12 '16 at 23:54
  • It's not feasible to create a folder with an action that creates aliases because how would that folder know that that you want an alias of one file and not another. The easiest way is to hold Cmd-Option while dragging the newly created alias to the folder. – Allan Aug 12 '16 at 23:56
  • @Allan I don't think it's a duplicate. If I understand the OP correctly he wants a folder "Inspirational" which doesn't absorb files from the downloads folder if a subset of files is dragged to it, but creates aliases of those files only - which should be possible without keyboard interaction. I would say: trying to organize the mess with a bigger mess – personally I hate those clients' Macs with 800 files in the download folder. – klanomath Aug 13 '16 at 0:19
  • @klanomath - What made me see this as a dupe was his 5th sentence... "It would be nifty to be able to drag and drop..." as well as his last sentence in which he repeats "...simply drag files instead of moving...." I might be mistaken, but it sounds like he wants to drag and drop to create an alias. I'm with you on the sizable download folder. I think I have 10 or 15 in mine right now and it's driving me crazy. – Allan Aug 13 '16 at 0:26
  • I might be missing something but why do you need aliases at all? I've had a folder on my dock for years where I stick funny internet images that I find (though I haven't actually used it in a long time) just by dragging and dropping from the browser into that folder. What purpose do the aliases serve? – tubedogg Aug 13 '16 at 3:05

Simply create a folder action script, move the scpt file to /Users/user_name/Library/Scripts/Folder Action Scripts and apply it to a folder:

The content of the script is:

on adding folder items to thefolder after receiving theAddedItems
    repeat with eachfile in theAddedItems
        tell application "Finder"
            make new alias file to eachfile at folder "Main_Volume_Name:Users:user_name:Desktop:Inspirational:"
        end tell
    end repeat
    repeat with eachfile in theAddedItems
        tell application "Finder"
            move eachfile to folder "Main_Volume_Name:Users:user_name:Downloads:"
        end tell
    end repeat
end adding folder items to

With Main_Volume_Name: the name of your volume (e.g. Macintosh HD – you don't have to escape spaces!) and user_name: your short user name.

Save the scpt to /Users/user_name/Library/Scripts/Folder Action Scripts/ with the name "alias - add alias instead of moving files.scpt".

Now create a folder "Inspirational" on your desktop and a folder "intermediate" somewhere else.

Right-click the folder "intermediate" and attach the above script to the folder:

enter image description here

Drag both folders to the dock. You may apply convincing icons to be able to tell which is which. If the folder action is activated, applying an icon to the "intermediate" folder will already create a file named _icon alias (or similar) in "Inspirational" folder. Please delete this file. In the example below the rose indicates the "Inspirational" folder and the chalkboard the "intermediate" folder

To create (an) alias(es) in the folder "Inspirational" drag one or several files and/or folders on the "intermediate" folder:

enter image description here

The aliases will be created in the folder "Inspirational" and the dragged files will be moved back to "Downloads":

enter image description here

You can't use only one folder, because this will invoke an endless loop: as soon as a new alias is created by adding a file to the folder action enabled folder, the new alias will be aliased itself too (because it's another "new" file). This would be repeated until your Mac dies!

  • Thank you! You got it. And well explained. I wonder if it would be possible to temporarily rename the alias so the conflict wouldn’t happen and then set the original name of the new alias after the file is moved back to the Downloads folder. This would eliminate the need for the intermediate folder right? – SarenSabertooth Aug 14 '16 at 3:01
  • @RenéHupfer No that wouldn't work. If you have one folder only the following happens. File1 -> folder -> Create Alias1 (in folder) && move file1 back to Downloads -> Create Alias1Alias1 of Alias1 (because Alias1 is a new file in folder) -> Create Alias1Alias1Alias1 of Alias1Alias1 (because Alias1Alias1 is a new file in folder) -> and so on - Alias1Alias1 and any new AliasOfAlias won't be moved to anywhere because it was not in the initial theAddedItems list (only file1 was!). – klanomath Aug 14 '16 at 3:06
  • Got it. It would have to have some sort of identifier. Getting very complex probably beyond of scripting. I guess Apple intended to use labels for that. The common solution would probably be a smart folder for a certain label and to add the smart folder to the dock. – SarenSabertooth Aug 14 '16 at 3:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .