In the Mac Finder - Manually you can control click on a particular file β And then hold the option key down in addition and it gives you the ability to copy "xx" as pathname.
Using keyboard Maestro, is there a way to capture the file path of the current highlighted file?
That's not an autonomous macro - that's a sub-macro (hence the odd name, and the absence of any trigger) called as a library resource by:
Copy front document as Markdown link
If you select a contact in macOS Contacts.app, and run Copy front document as Markdown link (default trigger on my system is β₯βM) then it should copy a url for you.
(behind the scenes it will draw on the com.appleAddressBook sub-macro, which only functions in the context of main macro)
Similarly, in Finder, select a file or folder, and run Copy front document as Markdown link, and it should copy an MD link to the file (making use of the com.apple.finder function in the process).
All of those functions need to be together in the same macro group, with the name MD link tools.
If there are any that you will never need, you can prune them out.
If any are missing (the main macro reports that a special module would be needed), then I may be able to add one.
As I stated above, if all you want is the POSIX Path of the file:
If you want a MarkDown link that will open the file, then this very simple AppleScript (which is easy to read and modify) will do the job:
tell application "Finder"
set {oFile} to selection
tell oFile
set fileName to its name
set fileURL to its URL
end tell
end tell
set mdLink to "[" & fileName & "](" & fileURL & ")"
return mdLink
No doubt, there are loads of keyboard shortcuts, more than anyone can be expected to remember. Perhaps worth knowing, however, is that the shortcut JMichaelTX shared is displayed when holding the Option key down while selecting the Edit menu in the Finder. The broader value in that tidbit is that any of the added shortcuts available by holding Option down when selecting a menu are visible this way, in any application.