For those that want to be able to cut and paste, there are workarounds. After I saw this thread initially several weeks ago, I decided to make an exhaustive search to see if anyone had come up with anything. Anyway, there was a software solution that allowed a plugin to be used, but that was ended with Snow Leopard. I've come up with two ways:
First, and the one that's more of a pain, since it involves using the keyboard when pasting: Go
here to get two programs, Shortcuts and OnMyCommand (OMC). Open OMCEdit, which is part of the OMC package.
You're going to need two scripts, one for cut and the other for paste.
For cut, the code is:
Code:
echo "__OBJ_PATH__" >/tmp/cut_${USER}
For paste:
Code:
cat /tmp/cut_${USER} | xargs -J % mv -f % __OBJ_PATH__ ; rm -f /tmp/cut_${USER}
These scripts were written By Fredrik Andersson (fan@gaffophone.com), 2003-11-05. I suppose he must be a developer for OMC.
Go to OMCEdit and make a new plist. Add the cut script to General>Command and save somewhere safe. Name it Cut Item(s), or whatever you want in Command Name (sorry forgot to mention that and didn't feel like rewriting). Do the same as above for paste, but call it Paste Item(s).
Now go back to OMCEdit, File>Import Commands and import Cut Items(s) so it will be added to the sample command "Hello World" on the left pane. Under General>Location make it Top Level and click Enabled if it's not already. You can unclick "Hello World," if you wish or even delete it, so it doesn't show up when you do the cut/paste operation. Do the same as above for Paste Item(s).
Quit OMCEdit and open Shortcut32 (Shortcuts, the 64 bit version doesn't seem to work for Finder operations, probably because it's not 64 bit). You need to assign a hot key to open the Paste operation, since the code wasn't written to have focus when not clicking on a folder. Assign a hotkey to Folder (I did file also, but it's probably not needed). I used shift-command-X and assigned the Paste Item(s) command to it. Go under Setup and click start, add, and add for the 3 items.
With that when you right click on a file (or files) you can choose to cut, and then paste them anywhere with the keyboard shortcut. FYI, you can also not have to use the shortcut, if you right click paste on a folder.
So, that one works anywhere.
Second, and the method that only uses a mouse (the one I like better), but can only be used in Finder, involves using AppleScript:
Code:
(*
Cut Files in Finder.scpt
Version 0.3
Author: Jayson Kempinger < evilglowingapple (at) gmail (dot) com >
Date: 19 April 2006
This script is released under the GNU Public License v2
The code for the error block for converting selected Finder items to POSIX paths (via aliases) used (mostly unmodified) from FileVault-proof Finder selection to alias list 1.2 at http://scriptbuilders.net/files/filevaultprooffinderselectiontoaliaslist1.2.html
Disclaimer. Read before using this script!!!
*********************************************
This script carries no warranty, expressed or implied. The user assumes all risks, known or unknown, direct or indirect, which involve this software in any way.
This script uses the UNIX command 'mv' to move files in an attempt to add a cut files feature to Finder. This command is quite powerful and unforgiving if invoked incorrectly. As the script is fairly new and hasn't been fully tested, there is no guarantee that the script will select the correct files to move, and no guarantee the script won't accidently move your files to an unknown place, or worse, delete them. From my preliminary testing the script has worked successfully, but I hold no responsibility if the script fails to act as intended.
If you do encounter any problems with this script, feel free to send me a bug report at my e-mail address listed above. Send me any information you have about what happened as well as any Applescript error messages. I may be able to improve the script for future versions. Also please send me suggestions for how to make this script better (or feel free implement them yourself and e-mail me the code).
Instructions:
*************
Assign this script to run via a keystroke/mouse action/etc. I recommend using Quicksilver's triggers to assign it to a key combination such as Command + Option + X. You can also save this script as an application and run it from a convenient spot (Finder toolbar, Dock, etc).
The 'cut' operation consists of two steps:
1. Select some files, run the script to set the list of files to be moved
2. Open a Finder window in another location, run the script again to move the files previously selected to the location of this window (if files are selected here they will be set to the list of files to be moved and non of the previously selected files will be moved; they will just be ignored)
*)
--set this property to true to only copy the files (good for testing)
property debug : false
--set here only so that it can be available globally
property state_file : ""
on run
--get state of script (select files || move files to target)
do shell script "mkdir -p /tmp/`id -u`/"
set state_file to do shell script "echo /tmp/`id -u`/cut_script_state"
try
do shell script "test -e " & state_file
on error
select_files()
return 0
end try
move_files()
return 0
end run
--get source files
on select_files()
tell application "Finder"
activate
--gets list of selected items from Finder
set selected to selection
--unselect items to show that something was done (analog to greying out items in Windows)
set selection to {}
end tell
--can't find a way to convert the entire list to aliases, so have to do it iteratively
--set file_list to selected as alias
set file_list to ""
repeat with n in every item in selected
try
set path_n to get the POSIX path of (n as alias)
on error errormsg
--code for error block used (mostly unmodified) from FileVault-proof Finder selection to alias list 1.2 at http://scriptbuilders.net/files/filevaultprooffinderselectiontoaliaslist1.2.html
-- if error, the item is FileVault-protected and the Finder can't coerce it into an alias
-- the error message is parsed into a list containing the item's path components
-- first, all quote characters inside the item's path components' names in the error message
-- are replaced by an unused marker string
-- the marker string will later be used to reinsert these quote characters
set markerString to "xyzabazyx" -- any palindrome string of only alfanumericals will do
repeat while errormsg contains markerString
set markerString to markerString & markerString
end repeat
set oldTIDs to AppleScript's text item delimiters
set AppleScript's text item delimiters to {"\\\""}
set theLst to text items of errormsg
set AppleScript's text item delimiters to {markerString}
set messageWithoutQuotes to theLst as string
-- next, the string is parsed at the quote characters outside the item's path components' names
set AppleScript's text item delimiters to {"\""}
set theLst to text items of messageWithoutQuotes
-- the item's path components are filtered and rearranged into the item's path
set idCounter to 1
repeat with i in (items 2 thru -4 of theLst)
if idCounter is 1 then
set idCounter to 0
try
set pathString to i & ":" & pathString
on error
set pathString to i
end try
else
set idCounter to 1
end if
end repeat
-- finally, all quote characters inside the item's path components' names are reinserted by
-- replacing the marker string
set AppleScript's text item delimiters to {markerString}
set theLst to text items of pathString
set AppleScript's text item delimiters to {"\""}
set pathString to theLst as string
set AppleScript's text item delimiters to oldTIDs
-- the item's path string is coerced into its alias without the Finder
try
set path_n to get POSIX path of (pathString as alias)
on error
set path_n to get POSIX path of ((pathString & ":") as alias)
end try
end try
--trim off trailing '/' if there (can appear if using FileVault fix above)
if last character of path_n is "/" then set path_n to characters 1 through ((length of path_n) - 1) of path_n as string
--need to escape any spaces so mv command doesn't fail with files with spaces in them
set path_n to quoted form of path_n
set file_list to file_list & path_n & " "
end repeat
--write files to tmp file if there are any files
if not file_list is "" then
do shell script "echo \"" & file_list & "\" > " & state_file
end if
return 0
end select_files
--files have been selected, now move them to selected folder
on move_files()
--target path is front window
tell application "Finder"
activate
set target_folder to (the target of the front window) as alias
set selected to selection
end tell
--check if files are selected, if so, call select_files to redo file selection
if selected is not {} then
display dialog "reselecting files"
select_files()
else
--nothing selected, let's paste
set target_folder to get POSIX path of target_folder
set target_folder to quoted form of target_folder
--load file names back into array
set file_list to do shell script "cat " & state_file
--move files to target dir
try
if debug then
--note, there will be no progress of the copy
do shell script "cp -R " & file_list & " " & target_folder
else
do shell script "mv " & file_list & " " & target_folder
end if
on error errormsg
--if same folder as source will show here. Prompt user to select another folder and don't clean up
set temp to do shell script "echo \"" & errormsg & "\" | grep -c \"are identical (not copied).\""
if temp is "1" then
--prompt to select another directory
display dialog "Cannot move files to the same directory, please select another folder and run this script again." buttons {"OK"} default button 1
return 1
else
--something else went wrong, show error and delete state_file
cleanup()
display dialog "Error encountered while attempting to move file:" & return & errormsg buttons {"OK"} default button 1
return errormsg
end if
end try
cleanup()
end if
return 0
end move_files
--delete temp file
on cleanup()
return do shell script "rm -f " & state_file
end cleanup
Thanks to Jayson Kempinger < evilglowingapple (at) gmail (dot) com for this.
Just paste that in the AppleScript editor, save it as an application with whatever file name you want, and then drag it to the right of QuickLook and Action in the Finder window. With that you can then click on any files in Finder, click the app, they'll be cut (but still there like Windows cut), and then you can go to another window in Finder, click the app again, and the file(s) will be pasted.
so, there you go. Hate it or love it.
-aggie-