Out of interest, how are you getting the path of the Finder item into the Clipboard in the first place?
I think I know where you're going with this. I use ⌥⌘C to copy a path in the Finder. You could just add a filter to this.
Copy Path (with Tilde).kmmacros (42 KB)
Yes. It's why I approach this the other way around - doing the conversion as part of the copying rather than the pasting. Because it's at the copying stage in the workflow that I know I am copying a path that I am just about to paste into Keyboard Maestro.
And I think I'm doing it for the same reason as @iamdannywyatt - so that the Keyboard Maestro path names will work on all my Macs even if the Usernames are different.
Yes, but it can be much simpler as no checks are needed.
Right click the file/folder and on the contextual menu you will see the "Copy" option. If you hold OPTION/ALT, it will change to "Copy XYZ as Pathname".
Ah yes, that's really nice. Using that %FinderSelection% Token avoids any variables and gets it down to just two Actions. So, I've discovered something today! I will edit my Macro in my first post.
Well we've managed to save you even more time then!
I have to explore what you posted. For now, you guys posted so many options and some of them are so over my knowledge that it feels overwhelming just looking at them hahaha
Regarding the "time" saved, sometimes it depends. Maybe I save a few seconds and clicks, but at the same time I need to memorize 1 more shortcut, so saving time is not always what I am looking for. If I can save time AND mind space, that's perfect!
If you want to copy any path, use opt+cmd+C. That's all you need to remember. (If it's a path to your user folder, it will abbreviated it using the tilde.)
I understand that, but what I mean is that "it's not all you need to remember", because you have all of the other shortcuts in your mind all the time. Since this is not something I need to do on a regular basis, right-clicking is ok. Also, I can keep that shortcut (or any other shortcut) to something more regular and useful.
As I mentioned, the option of just having the IF action and the Filter, seems to do what I need, so it's ok for now.
I appreciate all the other options anyway, because I always learn something new along the way.
Adding something I noticed today:
When you are inside a folder and nothing is selected, you can still create a path to that folder hitting ALT+CMD+C
With the macro shared by @noisneil with the FinderSelection option, this wouldn't work. So I had to change it and it's working for me now: