2 # shellcheck disable=all
4 # Description: Paste the clipboard files into the current directory.
5 # Only works if clipboard contents are files.
7 # Note: Supports only MacOS
9 # Shell: POSIX compliant
10 # Author: Syed Umar Anis
13 fs=($( osascript -e "use framework \"Foundation\"
14 property this : a reference to the current application
15 property NSPasteboard : a reference to NSPasteboard of this
16 property NSURL : a reference to NSURL of this
17 property pb : a reference to NSPasteboard's generalPasteboard
19 property text item delimiters : linefeed
21 pb's readObjectsForClasses:[NSURL] options:[]
22 (result's valueForKey:\"path\") as list as text" ))
24 cp -R "${fs[@]}" "$2/"