Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Moving folders in Finder without copying System
Due to a issue with Safari crashing I had to perform an Archive & Install OS repair. I recovered my user account from Time Machine but there isn't enough space or time to download all the pictures, movies and installers. So I figured I'd just move them from the old account folder. Only the finder wanted to copy the folders not move them. It would move the files. So I wrote an AppleScript script to force it to move the folders. Remember this is only for moving folders on the same partition.

on run
tell application "Finder"
 
set theSource to choose folder with prompt "Source"
set theDestination to choose folder with prompt "Destination"
move items of theSource to theDestination

end tell
end run


[crarko adds: I tested this, and it works as described. There was an earlier hint about moving (rather than copying) and some of the comments there presented other alternatives.]
    •    
  • Currently 2.48 / 5
  You rated: 1 / 5 (31 votes cast)
 
[57,860 views]  

Moving folders in Finder without copying | 27 comments | Create New Account
Click here to return to the 'Moving folders in Finder without copying' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Moving folders in Finder without copying
Authored by: oblahdioblidaa on Aug 02, '10 07:47:56AM

You can also hold the Option key while dragging in the Finder to move rather than copy, in cases in which the Finder insists upon copying by default. Otherwise, the behaviour is, of course, that holding Option will copy files that would otherwise have been just moved.



[ Reply to This | # ]
Moving folders in Finder without copying
Authored by: tedw on Aug 02, '10 08:16:17AM

Actually, if you want to move files across disks, you use command-drag to force a move rather than a copy. There is no way to force a move when you are copying across owners.



[ Reply to This | # ]
Moving folders in Finder without copying
Authored by: BLAZE_MkIV on Aug 02, '10 08:54:41AM

Command drag worked for files but not folders. And changing the permissions had no effect.



[ Reply to This | # ]
Moving folders in Finder without copying
Authored by: tedw on Aug 02, '10 11:21:51AM

Command-drag works for folders for me (10.6.4). What version are you on?



[ Reply to This | # ]
Moving folders in Finder without copying
Authored by: Stormchild on Aug 02, '10 04:51:12PM

It's not like this is a recent feature. The option/command modifiers for explicitly copying or moving (respectively) have been around since at least System 7.



[ Reply to This | # ]
Moving folders in Finder without copying
Authored by: tedw on Aug 02, '10 04:55:31PM

yeah, that happens to me all the time. just this morning I "discovered" that you could use Expose to flip through windows application by application by hitting the tab/shift-tab keys while in Expose mode (a feature introduced in 10.3, so I learned). I still thought it was exciting, though. :)



[ Reply to This | # ]
Moving folders in Finder without copying
Authored by: Stormchild on Aug 02, '10 04:49:15PM

It's Command, not Option.

Holding Command tells the Finder to move instead of copy, when the latter is the default action (i.e. when moving from one volume to another).

Holding Option tells the Finder to copy instead of move (i.e. when moving something elsewhere on the same volume).



[ Reply to This | # ]
Moving folders in Finder without copying
Authored by: mantrid on Aug 02, '10 08:13:06AM

That's just bad GUI design. A simple Cmd-drag and password entry is all it would have taken up to 10.3 until they mucked it up in 10.4 and it's been that way since. I guess we'll have to make up for Apple's shortcomings with scripts like this.



[ Reply to This | # ]
Moving folders in Finder without copying
Authored by: neuralstatic on Aug 02, '10 10:00:57AM

why would it copy in the first place, instead of move? seems like it's a matter of a permissions issue that should be addressed instead of all these work arounds. during an arch and install it probably locks everything as system or root?



[ Reply to This | # ]
Moving folders in Finder without copying
Authored by: mantrid on Aug 02, '10 03:13:52PM

It isn't so much "a matter of a permissions issue that should be addressed", as a bad design choice in what to do in a situation when permissions wouldn't normally allow a move.

Before, it would ask for an admin password to authenticate for the move. Now it just makes a copy. Before, you could try to force a copy with the option-key if you didn't have an admin password, or if you actually did want a copy. Now, in contrast, there is no way for an admin to force a move without a workaround. In other words, before you could move or copy; now you can only copy. Compared to 10.3, it's a loss of fuction / downgrade in what used to be possible in a straightforward manner from the GUI.

The sad thing is Apple had it right, then screwed it up for no reason and now it looks like we're stuck with it.



[ Reply to This | # ]
Moving folders in Finder without copying
Authored by: mrmobius on Aug 02, '10 10:49:18AM

In the terminal

sudo mv "folder path to be moved" "destination path"

It's actually very easy even for non-terminal users. Open the terminal type sudo mv then a space then drag the folder/s you want on the terminal window to have the path auto fill. Then drag the destination folder on ther terminal window. Hit return, type your password and boom. All folders will be moved not copied.

In the case of the description you mentioned your user was most likely different for each user folder hence the copy not move. You could have lso changed ownership of the files to the new user and no copy would take place. In the terminal it's chown -r "new user" "folder or file"



[ Reply to This | # ]
Moving folders in Finder without copying
Authored by: BLAZE_MkIV on Aug 02, '10 12:14:00PM

I did the recursive change permissions in the finder get info window first. Only worked for the files not folders. The mv man page doesn't specify if it would copy or not and I didn't want it to fail after filling up my drive.



[ Reply to This | # ]
Moving folders in Finder without copying
Authored by: eagle on Aug 16, '10 11:33:05AM

From the manpage to 'mv' ...

"NAME
mv -- move files"

:)

"mv" moves files. "cp" copies files.

Anyway, most users probably wouldn't want to use the Terminal, but that's what I would have done.



[ Reply to This | # ]
Moving folders in Finder without copying
Authored by: frank_martin on Aug 02, '10 12:51:39PM
The OP writes that they did an Archive and Install. That procedure preserves the home directory, so there would be no need to recover it from Time Machine or move it from anywhere.

Did you mean that you did an Erase and Install? But if you did that, there should be enough room to recover your home folder from Time Machine, since there would be no duplication (and nothing to move, just a copy via Time Machine).



[ Reply to This | # ]
Moving folders in Finder without copying
Authored by: BLAZE_MkIV on Aug 02, '10 03:07:17PM

Well you'd think it would. The folder was there but the account itself wasn't.



[ Reply to This | # ]
Moving folders in Finder without copying
Authored by: Mega_Hertz on Aug 02, '10 10:50:07PM

when i use the script to move a folder, it works great but if i try to move it back to its originating folder, i get an error.

Applescript Error
Finder got an error: The operation could not be completed.


I can move it again to another new folder but never back to its originating folder.



[ Reply to This | # ]
Moving folders in Finder without copying
Authored by: auco on Aug 03, '10 06:51:19AM

First of all (already pointed out in the previous comments) there are better and simpler solutions to move a couple of files rather than invoking Apple Script (cmd + drag, terminal mv etc.)

Second, if I read the reason behind this, I'm stunned. Who would make a system restore after Safari crashes (usually, you'd read the crash log and then remove the offending files, most likely some installed Safari Extension or files located in the ~/Library/Safari folder or cleaning the prefs);

Third: moving the old home folder after creating a fresh user account could easily result in moving all the old crap again into the new user account. At least for users operating on a level on which they don't know how to move a file between volumes, as they surly will try moving the ~/Library folder as well. Don't get me wrong: I don't think it's bad not knowing this, I think it's questionable to publish a hint how to do this with AppleScript.

well, well, just my 2c...



[ Reply to This | # ]
Moving folders in Finder without copying
Authored by: BLAZE_MkIV on Aug 03, '10 06:28:28PM

First, as noted in previous comments the finder wouldn't move them. Only copy. It was faster to write the script than experiment with mv.

Second, Safari was crashing every time I closed a page. No extensions installed. Cleared prefs, reset, reinstalled safari, etc.

Third, As mentioned I didn't copy back all the files, thats why I needed to move the folder contacts over, Pictures, Movies, Downloads etc.



[ Reply to This | # ]
Moving folders in Finder without copying
Authored by: mantrid on Aug 04, '10 05:35:39AM

I'm not the submitter, but it's pretty obvious most people commenting don't get it. As pointed out earlier, the GUI doesn't allow moves across owners or where permissions otherwise don't allow it. The Cmd key DOES NOT do it. The whole Cmd-key discussion is off-topic. It wouldn't have been off-topic five years ago, but whoever Apple brought in to work on the Finder after 10.3 probably wasn't familiar with Mac conventions and broke it. Or maybe the "flexible engineering team" concept shunted the developer off to another project before they could get around to fixing it.

Yeah, so Cmd-dragging in the Finder (the "force move" action by Mac convention) doesn't do it, but using AppleScript to tell the Finder to move still works correctly. It is a workaround that shouldn't even be necessary, but it does work. Yes, the command line could also be used, but then why am I paying the Apple tax when I could use Linux for free? Maybe we should all be asking ourselves this question.

The example used (post-archive and install) is just that, an example. It isn't important. People getting hung up on the example are also missing the point.

Apple and the GUI gets one star. This hint deserves five stars for drawing attention to the deficiency that Apple has shown no interest in rectifying since dropping "Computer" from their name, and should get five stars for providing a functional GUI-based workaround for it.



[ Reply to This | # ]
Moving folders in Finder without copying
Authored by: mrmobius on Aug 04, '10 06:53:47AM

I see what you are saying with this, but the more I think about it, this seems to reveal a security problem rather than a feature. The main problem the poster is having is getting past user permissions not a file move. In UNIX all files are set with permissions. User folders are set to No Access for all other users on a system, and READ Only for the the root level of each respective user. With one user this is really a non-issue but with multiple users on the same machine the individual user folders are not visible nor read/write to each other user. This is a GOOD thing. This means that without administrator access and a knowledge of sudo in the terminal, users can not copy from or to other users folders on the same machine. This AppleScript seems to negate that without administrator access which would seem like a security bug not a feature.

Also the author may not have tried to do a get info on the folders in question and simpy change the ownership to his current user, then move the files in the Finder with the command key.



[ Reply to This | # ]
Moving folders in Finder without copying
Authored by: mantrid on Aug 04, '10 07:28:46AM

Who said anything about circumventing permissions or doing anything without administrator access? When required, a cmd-drag in Panther invokes an authentication dialog so that an administrator could organize things quickly from the GUI. Tiger and later, an admin in this situation can't move from the GUI at all.

Ugh, this is the biggest problem with Apple's increased market share. Too many recent switchers and newbies that have no recollection of how elegant the Mac used to be even just five years ago, unable to recognize how kludgy OS X has become, blissfully unaware that they are settling for mediocrity are drowing out the voices of those who realize how good it could actually be.

You tell your computer to move some files and it copies them instead. It won't move them no matter what. How are people defending this? Change the ownership and then move as an alternative? Once you have changed the ownership or permissions you wouldn't even need the command key so do you even know what you are talking about? Maybe check your facts before posting irrelevant comments prepended with "seems" to substitute for actually testing something first. Regardless, you could have done the two step move in 10.3 if you wanted to as well, but how is that better than just moving it in one step as was once possible? Less consistency with Mac conventions, reduced capabilities overall. It's a downgrade.



[ Reply to This | # ]
Moving folders in Finder without copying
Authored by: mrmobius on Aug 04, '10 10:53:46AM

From the original post "So I figured I'd just move them from the old account folder. Only the finder wanted to copy the folders not move them. It would move the files. So I wrote an AppleScript script to force it to move the folders. Remember this is only for moving folders on the same partition."

From an old user folder to a new user folder on the same partition. This is a permissions issue not a Finder issue at it's root. I guarantee that the newly created user was not the same short name as the user he was trying to restore from hence the copy and not move. POSIX unix issue.

Would it be nice to force move a folder from the Finder by command dragging and get an authentication box? Yes. But if you are already working at that level of understation the terminal is your best friend. I used to hate the terminal. GUI is great and the terminal has it's uses as well and can be faster than the GUI for certain tasks. I prefer to take the best of both with a little apple script on the side.

FYI, I am a 15 year veteran of the Mac OS from system 7.1 as a professional up to the latest, including my ACTC (apple certified technical coordinator).



[ Reply to This | # ]
Moving folders in Finder without copying
Authored by: BLAZE_MkIV on Aug 04, '10 12:13:09PM

Don't ask me why the finders get info window didn't change the permissions like it showed it did. The recursive change took quite a long time too. I usually only resort to things like this when the obvious way fails.

FYI: My first Mac was a Mac Plus with System 4. Which I still have, and still works.



[ Reply to This | # ]
Moving folders in Finder without copying
Authored by: junk666 on Aug 05, '10 07:12:09PM

Isn't your Time Machine backup on another drive volume? How can you make a backup on the startup volume? That wouldn't exactly serve the purpose of backup. You drag the files from the backup volume to the startup volume. Why would you expect Finder by default automatically to delete files that you copy from one volume to another? That doesn't sound like a reasonable default behavior.



[ Reply to This | # ]
Moving folders in Finder without copying
Authored by: PizzaCake on Nov 12, '11 11:50:44AM

Thanks, useful hint for me. Annoying how Finder insists on copying a folder (100 GB!) when I'm moving it to another location on the same disk and I've checked ignore permissions on disk!



[ Reply to This | # ]
Moving folders in Finder without copying
Authored by: unltdthinking on Apr 08, '12 05:18:11AM

Thanks Mrmobius and Eagle. The terminal worked great with sudo mv to move folders around. However now my old user is tidied up a bit, I am trying to figure out how to force move a folder into the shared folder, to then transfer it to my new user account (the old one was littered with permission issues that caused no end of hassle). I am running Mac OSX 10.7.3.
Thank you for your help!



[ Reply to This | # ]
Moving folders in Finder without copying
Authored by: Poppae on Aug 19, '14 12:33:28PM

An UTTERLY UNINTUITIVE, but easier way is to move the files or folders to the Trash - and then from the Trash to the intended location.

Due to Ownership issues (slightly different than Permissions issues), the Finder won't allow you to Move the files, but it WILL allow you to Delete them - as long as you have an Administrator name/password.

Select the files/folders, press & hold the Command key and tap the Delete key once- POW, into the Trash.

The Finder will ask for password authentication.

ProTip: Empty your Trash BEFORE doing this, in order to avoid teeth-gnashing mistakes.

Alternatively, you could use the Terminal and the Chown command.



[ Reply to This | # ]