1

I'm trying to create an automator workflow that starts out by finding all symbolic links in a given directory.

What's happening however is that even if I set it to return "all files", I end up with every single file except symbolic links. Automator seems to be unable to see them at all.

Is there a way to get Automator to return symlinks (not aliases)?

1

I'm unable to reproduce this. Automator seems to returns all files/folders, whether they are symlinks or not.

  1. I set up the following:

    $ mkcd testfolder
    $ mkdir originalfolder
    $ ln -s originalfolder symlinkoforiginal
    $ ls
    total 24
    drwxr-xr-x   5 grgarside  staff   170B 23 Jul 20:04 ./
    drwx------@ 11 grgarside  staff   374B 23 Jul 20:04 ../
    -rw-r--r--@  1 grgarside  staff   6.0K 23 Jul 20:04 .DS_Store
    drwxr-xr-x   2 grgarside  staff    68B 23 Jul 20:04 originalfolder/
    lrwxr-xr-x   1 grgarside  staff    50B 23 Jul 20:04 symlinkoforiginal -> /Users/grgarside/Desktop/testfolder/originalfolder
    
  2. I ran the following Automator workflow:

As shown in the results, both the folder and the symlink were returned.

  • Interesting... yes your solution does return all files, but what I was doing was using Find Finder Items to attempt to specify symlinks only, and that's what doesn't see them at all. I may be able to work with this but do you have any idea why Find Finder Items cannot see symlinks? – Jonathan van Clute Jul 23 '14 at 19:14
  • @Jonathan Ah, I presume Find Finder Items uses Spotlight mdfind which doesn't see symlinks either. – grg Jul 23 '14 at 19:16
  • Aha, that would make sense. It seems that Filter Finder Items does too, in which case how on earth can I select only symlinks? – Jonathan van Clute Jul 23 '14 at 19:24
  • @Jonathan I don't think that's possible without doing some shell scripting (or using a custom action if one exists). – grg Jul 23 '14 at 19:26
  • Drat... I do have a command line that will get me what I want, will look into executing it within automator. Thanks... – Jonathan van Clute Jul 23 '14 at 19:27

You must log in to answer this question.

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