Hi there, I would like to set up a shortcut for when i'm in the finder, to select one or multiple files and, after pressing the key combination, it automatically moves them into a predetermined folder. I figured out i could just simply use the "mv" terminal command but i don't know how to get dynamically the original path of the file(s) i selected.
I hope someone will be kind to reply to this stupid question, or maybe if you have a walkaround to do the same thing, it's highly apprecciated
Thanks
Try AppleScript:
set unixPath to missing value -- or set to your folder e.g "/Users/YourUsername/Desktop/YourFolder/"
tell application "Finder" to set theObjects to selection
if (count of theObjects) is 0 then
return
end if
if unixPath is missing value then
set targetFolder to choose folder with prompt "Choose destination for selected items"
else
set targetFolder to POSIX file unixPath
end if
repeat with i in theObjects
tell application "Finder" to move i to targetFolder
end repeat
tell application "Finder" to reveal targetFolder
Thanks man. Works smoothly!