Rich

Rich / active-finder

Last active 1 hour ago

Like 0

Get selected items in active Finder window

active-finder Raw
1#!/usr/bin/osascript
2on convertListToString(theList, theDelimiter)
3 set AppleScript's text item delimiters to theDelimiter
4 set theString to theList as string
5 set AppleScript's text item delimiters to ""
6 return theString
7end convertListToString
8
9on run argv
10 set output to {}
11 tell application "Finder"
12 set selectedItems to selection as alias list
13 repeat with i from 1 to count of selectedItems
14 set end of output to quoted form of POSIX path of item i of selectedItems as string
15 end repeat
16 end tell
17 return convertListToString(output, "\n")
18end run
19