You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# @raycast.title Copy Finder Selection to Clipboard
6
+
# @raycast.mode silent
7
+
# @raycast.packageName System
8
+
#
9
+
# Optional parameters:
10
+
# @raycast.icon ??
11
+
#
12
+
# Documentation:
13
+
# @raycast.description Copy contents of selected items in Finder to the clipboard. If there's more than one file selected, they will be combined and added to the clipboard.
14
+
# @raycast.author Felipe Turcheti
15
+
# @raycast.authorURL https://felipeturcheti.com
16
+
17
+
onrun
18
+
log"Copying contents of the selected items to the clipboard..."
19
+
20
+
tellapplication"Finder"
21
+
-- get Finder selected items
22
+
settheItemsto selection
23
+
end tell
24
+
25
+
-- create a list to store contents of all selected items
26
+
setallContentsto""
27
+
28
+
-- for each item in the Finder selection
29
+
repeatwithitemRefin theItems
30
+
-- get the item path
31
+
settheItemtoPOSIX pathof (itemRef asstring)
32
+
-- read the content of the item
33
+
setfileDescriptortoopen for access (POSIX file theItem)
34
+
setfileContenttoread fileDescriptor for (get eof fileDescriptor)
0 commit comments