I managed to "break" the desktop folder on our macbook. I'm not sure exactly how it happened, but I'd started to copy an application to the desktop using Terminal, and then thought it wasn't working so quit the copy. Every time I clicked on the Desktop in the Finder, the Finder would thrash and other applications became uncooperative. Clicking on Desktop in the home folder or in the sidebar led to the message that 'there is no default application to open the document "Desktop"...,' which was rather worrying. I managed to copy the folders on the desktop to the home folder, so it was empty but still broken, and anything saved to it would go who-knows-where.
I was thinking I might have to do an archive-and-install, which would have been a pain, but then I remembered seeing Apple's article on how to change a user's short name, which involves copying the files from one home folder to another. So I created a new user 'test' and got to work.
Here's how I solved it, while logged in to the troublesome account. In Terminal, I ran these two commands (where myuser is the short username for the troublesome account):
This would, of course, delete anything left on the desktop if it wasn't empty, so use with care (have you backed up lately?). I could probably have used cp in Terminal to copy things out of the desktop first, if it wasn't empty already. I'm not sure what caused this problem, but this has solved it. Possibly it was some sort of permissions problem, or the Finder was seeing the desktop as a package from the failed copy command.
I hate the name that the Finder gives duplicate files, as it adds copy at the end of the name but before the extension. This makes renaming files a bit more of a pain. Rather than creating a name like my file copy.ext, I'd like it to be copy of my file.ext, so I can easily select the beginning and have copied files all sorted together.
The way to fix this is easy. Go to /System » Library » CoreServices » Finder.app, control-click on Finder.app, and select Show Package Contents from the pop-up menu. This will open up a new window with all the files inside the Finder. Be aware that you can mess up the Finder up by modifying these files.
Go to Contents » Resources » English.lproj » Localizable.strings, and edit it in your favorite editor (I used Smultron). Search for N4, and you'll find a line that looks like this:
"N4" = "^0 copy";
I changed mine to:
"N4" = "copy of ^0";
Save the file, restart the Finder (using Activity Monitor or Terminal), and you should find duplicated files are now named according to your preferred string.
Many will find that when selecting a number of images greater than 99, control-clicking and choosing Slideshow will result in a slideshow that only contains 99 photos. The remaining photos will not be present in the index sheet, nor will they be shown at any time. So instead of using the Finder for large slideshows, use Preview instead:
Select a range of photos by using a shift-multi select or Command-A.
Instead of using control-click » Slideshow, double-click on your selection to open the files in Preview. (Drag and drop them to Preview's icon or use the contextual Open With menu if they're not normally opened by Preview.) All of your files should be shown in the drawer (this may take awhile to load for a few hundred photos. The load time can be can be optimized by reducing the size of the preview drawer thumbnails.)
Select View » Slideshow, and enjoy your massive slideshow!
Important note: For any number of photos greater than 499, the Index Sheet will no longer be available in the full-screen slideshow, although in my testing, the photos above 499 are still seen in the slideshow itself. It appears the authors decided the thumbnails would be too small after 20 rows and 25 columns of entries in the index sheet; probably a reasonable choice.
Many of us have found a profiles.bin file in our home folders. Many think it is created by MS Office for some reason, but nobody knows for sure. Everybody hates it and tries to remove it, to no avail: the file will respawn the next time you open MS Office. The file is completely useless, as far as anybody can tell.
I don't suggest a solution to the issue, nor an explanation; just a cool workaround to have that file delete itself every time you open its containing folder. It does so by means of a Folder Action. Folder Actions are pieces of AppleScript code to be executed automatically every time you open or close a folder, or add/remove items to/from it.
Here's how to create the one we need. Open Script Editor (in Applications » AppleScript) and type the following script and then click Compile to test for (most) spelling mistakes:
on opening folder
tell application "Finder" to delete file "profiles.bin" of home
end opening folder
Save the script as Delete profiles_bin somewhere appropriate, such as in Home » Library » Scripts » Folder Action Scripts (this is where Automator saves its folder actions), then open a Finder window. Control-clik on your home folder in the sidebar and select Enable Folder Actions. From the same menu, choose "Attach a Folder Action" and point it to the file you just saved
Done! Now every time you open your home folder in Finder, if a "profiles.bin" file is there, it will be deleted! Obviously, you could easily modify the above script to work on any other unwanted files that are automatically generated.
[robg adds: From what I can find on Google, it seems this issue only affects non-English versions of Office. I checked my machines, and none of them had the file. There are other solutions to this problem, of course. For instance, you could use Terminal and a cron job set to run once a day (or whenever) to check for and delete the file if found.]
I have had this same problem occur quite a bit in the last couple of months at my work, where I support many Mac labs and Mac laptops. I have seen this on several machines where you log in and the Finder just crashes and you get the spinning beach ball of death. If you log into a new user account (we have hidden accounts for diagnosis and administrative use), the OS runs absolutely fine. So you immediately think it is a problem with the user account. You do all the standard troubleshooting of clearing out .plist files, caches, application data, temp files, etc. However the problem persists.
While troubleshooting this issue, I decided to enable fast user switching (FUS) so I could log back into my admin account to make system changes in a timely manner. I noticed once I enabled fast user switching and switched from my working account to the account in question, all was suddenly well again. I have duplicated this method on several other machines at work, too. These range from intel iMacs, G4 to G5 desktops, G4 iBooks, G4 powerbooks, Macbooks, and Macbook Pros.
So if anyone runs into this issue where all the standard troubleshooting methods do not work, log into a different user account, enable FUS, and then switch from a good known user, then switch to the user in question and then it works. I have no idea why this works, but it works and saved me from having to target mode and back up data and reimage because the user forgot to back up their data on the network drive.
[robg adds: I can't test this one, but it seems there must still be a user-related issue at work if the Finder is crashing on login. As a temporary fix, FUS may get the job done, but the bigger issue will still need to be resolved.]
As noted here in previoushints, you can't find Mail messages in a normal Finder search -- you either have to search in Mail, or use the Spotlight window. However, I wanted to run a search in the Finder, so I could easily see the size of all my saved Mail messages, regardless of which folder they lived in.
The answer is simple, and is alluded to in the previous hints (which show how to modify some files to make Mail messages always show up). However, I though it worth posting directly, in case someone is looking for a simpler solution that doesn't require modifying files.
In the Finder, navigate to your user's Library » Mail folder then press Command-F. Make sure the Folder "Mail" button is highlighted in the search bar, and then click the Kind pop-up menu. Select Other, and then scroll down the monstrous list that appears and find Raw Query. For the query string, enter kMDItemContentType = "com.apple.mail.emlx", and that's it. If you want to save the query for future use, click the Save button.
Once the query has run, you can press Command-A then Command-I to open the Get Info window and view the size of all the messages. I'm sure there are other ways to do this, but it was the easiest one I could come up with that accounted for all the various subfolders. You can easily build a Smart Mailbox in Mail to show all your stored email (I use Date Received - is after the date - 01/01/93), but I don't see any way to then display the total size of all the collected messages.
As I found out in some forums (i.e. this ancient Mac OS X Hint), the common way to change the login window's background picture is to replace the Aqua Blue.jpg in /Library » Desktop Pictures with your own image. However, there's a more elegant way to do this: by adding a value to the appropriate plist file, namely /Library » Preferences » com.apple.loginwindow.plist. You can do this in two ways, either with a Terminal command or by directly editing the plist file using Property List Editor from the Xcode package.
Open Terminal and type these two commands (the $ is the command prompt; don't type that):
Replace the /path/to... bit with the full path and filename of the image you'd like to use.
Property List Editor solution:
Launch Property List Editor (in /Developer » Applications » Utilities), and then open the com.apple.loginwindow.plist file from /Library » Preferences. Add a New Sibling of class String with the name DesktopPicture. In the Value column, enter the complete path to the new image you want to set as the login window backgroung image. For example, you'd use this...
...to use the Apple-supplied agave plant picture. Please keep in mind that you need the correct user permissions to edit the plist file; save the changes and quit the editor when done. After using either method, log out and you should see your new login window background picture.
I found out that this was possible by exploring the /System » Library » CoreServices » SecurityAgentPlugins » loginwindow.bundle » Contents » MacOS » loginwindow executable in detail.
After reinstalling my system recently, I had a look at the mess my windows had turned into, and started looking into AppleScript as a means to set my windows to my preferred view settings. As it turned out, there was no easy way to set the "All Windows" option -- the only scriptable commands in Finder applied to "This Window Only" settings. Then I learned about GUI Scripting, and after a couple days of trial and error I got the thing to work reliably -- here's the code.
What the script does:
You can either drop items into it or open it, in which case you will be prompted to open a folder. At the start, Finder is activated, all Finder windows are closed, and the "Show View Options" window is opened. The script also stores the username of the current user, which it needs for checking read rights for folders.
The script processes both disks and folders recursively. Each disk or folder is set to icon view, opened, moved and resized, and the sidebar width is set. Then the "This Window Only" icon view options are set to my defaults. Then "All Windows" is set for icon view options. Next, the "This Window Only" list view options are set to my defaults, and finally, "All Windows" is set for list view options. Last of all, the zoom button is clicked, which resizes the window. After all disks and folders have been processed, a dialog box is shown stating the number of folders/disks processed.
Note that you should not do anything else on the computer while the script is running. The script depends on the Finder windows remaining in a certain order, and Finder must stay active. If you do want to stop the script, close any window, and the script will harmlessly crash, displaying an error message. Note that the script takes a long time to run: in my tests, processing 300 folders took about an hour.
I'm one of those "keep my hand on the keyboard at all times" sort of guys. So I was annoyed recently when I discovered that there was no keyboard shortcut to set an item's color label in the Finder. While I don't always use the Finder's color labels, I often find them invaluable when working on projects with complex file and folder structures, indicating which files are "done" and which files are "pending." Using Butler's outstanding ability to execute any AppleScript code via a key combination, I set up the following script:
tell application "Finder"
set thisItem to selection as alias
if label index of thisItem = 0 then
set the label index of thisItem to 2 -- 2 = red
set label index of thisItem to 0 -- 0 = no label
I then set it to run with the arbitrary key-combination of Option-Command-Control-L. This code will toggle on and off the Red label only. However, using Butler and modifying the AppleScript, one could set a combo to toggle all the different labels on and off -- perhaps using one to six on your keyboard, with appropriate modifier keys.