I have a series of template files which I use regularly. I would like to be able to copy them to the clipboard when needed.
I would enter the file path in first line.
What would I enter in the second line below ?
Thank you
PS I am not trying to read copy the contents of a file. I am trying to copy the file itself, as if the file was selected in Finder and you pressed cmd-C
thank you. There is a misunderstanding. I am not trying to read copy the contents of a file. I am trying to copy the file itself, as if the file was selected in Finder and you pressed cmd-C
I found the solution but editing the AppleScript in the macro suggested by @kcwhat
It works perfectly
thank you again
tell application "Keyboard Maestro Engine"
set filePathToCopy to "/Users/ronald/card health insurance exp 31 march 2022.pdf"
end tell
set the clipboard to POSIX file filePathToCopy
This post was revised to make the AppleScript easier to read using @ccstone's excellent macro
Thank you @gglick I tested it and works perfectly.
Interesting tidbit about both methods:
If I use either the AppleScript above or your method using set system clipboard to file and then open my clipboard history to drag and drop the corresponding clip into Finder, Pathfinder or an app (DevonThink, Scrivener)
If I use my copy paste app called Copy'em → drag and drop the clip → I end up inserting the actual file with both methods.
If I use KM's clipboard history → drag and drop the clip → I end up inserting a text file containing the file PATH (not the file) with both methods.
Yes you are right. Thank you. My problem was that pasting a file works in Finder Pathfinder and DevonThink, but not in Scrivener. I needed a file drag and drop option.