newbie wants to use Automator to gather items

Discussion in 'Mac Programming' started by Brutalbrutus, Dec 24, 2011.

  1. Brutalbrutus macrumors newbie


    Nov 24, 2011
    Hello. I'm new to this but I'm a quick study and I hope someone can point me in the right direction. I'm trying to do the following:

    1. Select a number of items sprinkled hither-and-yon on the Desktop (Snow Leopard).
    2. Create a new folder on the Desktop with a title I give it.
    3. Move (not copy) the selected items into the new folder.
    4. Erase the now-duplicated items that are sprinkled hither-and-yon on the Desktop.

    I'm having the most trouble with #4, above. To simply *move* items into a new folder, all I need to do, I think, is

    1. Create a service.
    2. Get selected items.
    3. Make a new folder (the selected items are automatically passed into it).

    But in this example, the old, scattered items are still lying all over my desktop, so I have to select them *again* and then move them to the Trash. I don't want to have to do this last step. I want Automator to do it.

    Any thoughts? Many thanks in advance.
  2. Red Menace macrumors 6502

    Red Menace

    May 29, 2011
    Littleton, Colorado, USA
    Instead of making copies and then trashing the original items, why not just move the items? This approach is a little bit convoluted due to the nature of Automator, but would go something like:

    Service receives files or folders in Finder:
    1) Set Value of Variable { Variable: Original Items }
    2) New Folder (Ignore Input, Show action when workflow runs)
    3) Set Value of Variable { Variable: New Folder }
    4) Get Value of Variable { Variable: Original Items } (Ignore Input)
    5) Move Finder Items { To: drag New Folder variable here }

    The settings of the New Folder action above will show the action so that you can choose the name/location when the workflow runs, but if desired you can set it not to show and just enter a fixed name/location.

Share This Page