Automator: Service to list File Paths of selected items, into Text File

If you're looking for something that's more "pure Automator," here's one option (although, as was mentioned in the comments, right-clicking on the items in Finder, holding option, and selecting Copy Items as Pathnames is probably the easiest solution):

  • Accepts files or folders in Finder
  • Set Value of Variable Inputs
  • Run Shell Script: /usr/bin/dirname "$1" (make sure to pass input as arguments)
  • Set Value of Variable Parent Folder
  • Get Value of Variable Inputs <-- this should not accept input (right-click on the action and select Ignore Input)
  • New Text File (Plain text, [whatever file name you want], Parent Folder (drag this in from the variables list))

I've included a screenshot below:

Screenshot of Service


No script is needed, as this is already built into Finder (this works for one or multiple files):

  • Right click on the file(s) in Finder

  • Press and hold option

  • Select Copy [file name] as Pathname (or Copy [#] Items as Pathnames for multiple files) in the context menu

  • The pathnames are now saved to your clipboard. You can paste them into Notes or a text file