I have Googled and read the Wiki but I still can’t work out how to select the last used file in Finder. Let me explain...
Let’s say I copy a file, open a new folder and paste the file. What I would like is for that pasted file to be selected so that I can do something else to it like rename it. However, once the paste is complete no file is selected.
OK, the first thing to observe is that the last file put into a folder may NOT be the file with the most recent modification date. The properly you want to use is Date Added.
So, here's a simple example macro that will return the full path to the file last added to a given folder.
No need for a script
No need to select in Finder -- path returned in KM
Thanks everyone for your input. Some of it is a bit complex for me, but I tried to follow the Macro you posted @JMichaelTX re sorting through a list of files to get the one that was created most recently. This seemed to work sporadically. Not sure if it wasn't refreshing which file was newest or something.
Anyway, there is usually more than one way to solve an issue and I think I found it. So one of the things I wanted to do was to make an Alias of a file that I had moved. However, Alias is only available n KM by selecting the menu item or hotkey, so the file had to be selected. I then discovered that in Automator I can also create aliases. So I set up a simple Automator folder workflow which creates an alias for any file added to a certain folder. This now works in parrallel with the KM Macro that moves the file to that folder in the first place