Use AppleScript to return path name
I have multiple files selected in a folder and I need AppleScript to return the path of that folder. I am then passing it along to a Variable and using the Variable to set the save location of my workflow.
On another site I found it said to use this:
tell application "System Events" to return name of (item 1 of input)
But that results in an error later in the workflow. The problem is it returns the path multiple times... so if there are 4 files selected the path is returned 4 times and the save location is invalid.
How do I get it to return ONE path?