Hello everyone. After the discussion on moving files with the
finder, I thought it could be done easily with apple script, and
after a bit of fiddling around with it, I finally got it to work. I
initially tried to use the finder itself, but that was misbehaving,
so I resorted to using the terminal for the actual move.
** cut here **
tell application "Finder"
set btn to button returned of (display dialog "Move file or
folder?" buttons {"file", "folder"})
if btn is equal to "file" then
set file1 to POSIX path of (choose file)
else if btn is equal to "folder" then
set file2 to POSIX path of (choose folder)
else
display dialog "Error in script."
end if
try
set file2 to POSIX path of (choose folder)
set movestr to "mv " & file1 & " " & file2 as text
tell application "Terminal"
do script movestr
-- quit
end tell
--display dialog file1 & " was moved to " & file2
end try
end tell
** cut here **
The error checking isn't exactly correct, so don't depend on it (yet)
However, this does work, though you need to refresh your finder
window to see it, because for some reason, finder doesn't realize the
file was moved in the terminal <shrug>
Hope it helps someone.