The current script I'm using for getting file path for single selection in finder is
tell application "Finder"
set thepath to selection as text
set pospath to quoted form of the POSIX path of thepath
end tell
It gives me path like this: '/Users/lawsome/Desktop/jan-study/untitled folder/'
This format of path is working for passing single file path for further action like moving or deleting the selected file.
When I'm trying the same script for multiple selections in finder I get result like this:
'/Users/lawsome/Desktop/Business Org Feedback.pdfMacintosh HD/Users/lawsome/Desktop/Top 10Macintosh HD/Users/lawsome/Desktop/Follow_Up_letters_Samples.pdfMacintosh HD/Users/lawsome/Desktop/Learn Outlook Tips.txtMacintosh HD/Users/lawsome/Desktop/OutlookTips.pdf'
This result doesn't work for me. What I'm trying to achieve is to pass multiple paths for selected finder items for further action.
If I drag multiple files in terminal, it shows files path in a different format and that works for further action. How can I get the path correctly through a script or through a terminal command.