-
-
Notifications
You must be signed in to change notification settings - Fork 766
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
plugins for integration with MacOS clipboard
- Loading branch information
Showing
3 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/osascript | ||
|
||
# Description: Copy the hovered file to MacOS clipboard. | ||
# | ||
# Note: Supports only MacOS | ||
# | ||
# Shell: POSIX compliant | ||
# Author: Syed Umar Anis | ||
|
||
|
||
on run args | ||
set filePath to (second item of args & "/" & first item of args) | ||
tell application "Finder" | ||
set the clipboard to (filePath as POSIX file) | ||
end tell | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/usr/bin/env sh | ||
|
||
# Description: Paste the clipboard files into the current directory. | ||
# Only works if clipboard contents are files. | ||
# | ||
# Note: Supports only MacOS | ||
# | ||
# Shell: POSIX compliant | ||
# Author: Syed Umar Anis | ||
|
||
|
||
fs=($( osascript -e "use framework \"Foundation\" | ||
property this : a reference to the current application | ||
property NSPasteboard : a reference to NSPasteboard of this | ||
property NSURL : a reference to NSURL of this | ||
property pb : a reference to NSPasteboard's generalPasteboard | ||
property text item delimiters : linefeed | ||
pb's readObjectsForClasses:[NSURL] options:[] | ||
(result's valueForKey:\"path\") as list as text" )) | ||
|
||
cp -R "${fs[@]}" "$2/" |