I have a large number of aliases in a folder, and I want to create a macro that will navigate in the Finder to the original file corresponding with any given alias. Ideally I would select the file and press a hotkey that would take me to the original file.
It used to be the former prior to Mojave. I don't know what it is after Mojave...
If you need to get the original item of an alias for further processing then it's simple enough with AppleScript:
# Working with a selected alias in the Finder.
tell application "Finder"
set finderSelectionList to selection as alias list
if length of finderSelectionList = 0 then error "No files were selected in the Finder!"
set theItem to item 1 of finderSelectionList
set theOriginalItem to original item of theItem
end tell
# Working with the path to an Alias _File_.
set aliasFilePath to "~/Desktop/To Be Filed!"
tell application "System Events" to set aliasFilePath to POSIX path of (disk item aliasFilePath)
tell application "Finder"
set theOriginalItem to original item of file (aliasFilePath as «class furl») as alias
end tell
### Note that there is a difference between an AppleScript alias and an Alias File.
There are also a couple of command line tools available if that method is preferred:
While Keyboard Maestro can resolve symlinks with a filter, I don't believe it can resolve alias files.
There is a precompiled binary available for this one:
I don't believe there is a precompiled binary available for this one, but it's not too difficult to make if you have Xcode installed.
Good point, @ccstone. I don't remember when it changed to ⌘R but it definitely is with Ventura. Of course one could create a simple KM macro to select the menu File>Show Original which should work regardless.