Hey all,
I use Finder exclusively in List view and enjoy the ability to toggle nested folders without having to actually enter said folders. With a mouse, this makes it possible to move files around without having to jump back and forth between folders - however this is not possible on just a keyboard.
What I am essentially looking to be able do is:
- ⌘C a file
- Select (Highlight) some other nested folder (or file inside a nested folder)
- ⌘V to paste a file inside that folder (or ⌘⌥V to move it)
In the screenshot above, hitting ⌘V would paste valid clipboard content (a file or folder) inside folder B.
Essentially, a file would only paste inside the current path (as determined by the finder window) if a file inside that path is selected (e.g. 789.txt) or if nothing is selected (FYI, the shortcut to deselect everything is ⌘⌥A).
I tried to write an AppleScript to do this, but was unsuccessful. The script attempted the following:
FLOW
- Register the POSIX path of the currently highlighter item in finder
- If the item is not a folder, than it should strip the path to the folder the item resides in
- attempt to move the file that is currently in the clipboard into the folder of the highlighted item (or into the highlighted folder).
- If the file already exists in the destination, the traditional macos dialog box appears (cancel, replace, etc)
ERROR HANDLING:
- Nothing is selected (highlighted) in finder
- Clipboard content is not a file or folder
- Insufficient permission to move the clipboard item to the destination folder
- Destination path is invalid
- Insufficient disk space
- Other unknown errors
I worked with ChatGPT on this and got certain parts to work, but not in a solid and performant way.
I wonder if anyone knows of a better approach.
Many thanks