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

Completely disable quarantine of downloaded files System
Starting in Leopard (I believe) when you open a file downloaded from the web, OS X asks if you really mean it. While it is intended to stop maliciousness, it is only a source of aggravation for me. While there are some hints here on working around it, it turns out that you can disable it completely using a Terminal command:
defaults write com.apple.LaunchServices LSQuarantine -bool NO
After that, reboot, and you should be set. (If you want to disable quarantine for files already downloaded, you can run this in 10.6 : xattr -d -r com.apple.quarantine ~/Downloads. In 10.5, you need to use this instead: find ~/Downloads -type df -exec xattr -d com.apple.quarantine {}.)

The credit for this tip should really go to Jonathan 'Wolf' Rentzsch, who published it on his Tumblr. He, in turn, credits Ken Aspeslagh with telling him about the defaults write via Twitter.

[robg adds: This should work in 10.5 and 10.6, though I haven't tested it myself.]
  Post a comment  •  Comments (26)  
  • Currently 3.79 / 5
  You rated: 2 / 5 (58 votes cast)
 
[47,243 views]  View Printable Version
Minimize/unminize all windows in the active application System
Now that it seems increasingly unlikely that Unsanity will update WindowShade X for Snow Leopard, I wanted some kind of substitute. In Snow Leopard, you can minimize (actually "miniaturize") windows to the program's Dock icon (enable this in the Dock System Preferences panel), and you can double-click on a window title bar to do this. Nice and out of the way.

But getting such windows back requires excessive mouse movements. (Either activate Exposé and click on the window, or right-click on the application's Dock icon and select the window by name from a menu. Then you must mouse back up to the window. If you do this constantly, it gets very frustrating and prone to strain.

This AppleScript will either miniaturize all windows in the active (frontmost) application, or un-miniaturize them all. The difference between the two behaviors is controlled by one script property (theval). So create two versions of the script, one with theval set to true (to miniaturize), and one with theval set to false (to un-miniaturize). Here's the "miniaturize" version:
(*
Frontmost miniaturize / unminiaturize
by Wooden Brain Concepts
11-18-2009

miniaturize (to dock) or unminiaturize all windows in the frontmost app.
This works in many but not all applications.
Suggest using it with a keyboard macro program and/or a mapped mouse button, etc.

*)

-- theval = true : miniaturize ; theval = false : unminiaturize 
property theval : true
-- require windows to be resizable?  (default: false)
property requireresizable : false
-- must all windows have a title to unminiaturize only? (default: true)
property windows_must_have_titles : true
--window names to exclude when unminiaturizing only (default: {"Downloads", "Invite"})
property exclusions : {"Downloads", "Invite"}
-- gui scripting main window for these apps (by bundle id) (default: {"com.microsoft.entourage", "ws.agile.1Password"})
property guiscripting : {"com.microsoft.entourage", "ws.agile.1Password"}

tell application "System Events"
  set bi to bundle identifier of (some process whose frontmost is true)
end tell

(*
-- testing only
--set bi to "com.apple.finder"
set bi to "com.apple.itunes"
set bi to "com.apple.systempreferences"
*)

if not theval and (bi is in guiscripting) then
  (*
  this is special handling for some unscriptable apps.  this whole conditional can be eliminated if you don't use it. it requires "Enable access for assistive devices" in Universal Access Preference Pane to be on to enable GUI access scripting. have not yet figured out how to miniaturize to dock.
  *)
  set thisapp to ""
  set theindex to 1
  if bi is "com.microsoft.entourage" then
    set thisapp to "Microsoft Entourage"
  else if bi is "ws.agile.1Password" then
    set thisapp to "1Password"
  end if
  if not theval and thisapp is not "" then
    tell application thisapp to activate
    try
      tell application "System Events"
        tell process thisapp
          tell menu bar 1
            tell menu bar item "Window"
              tell menu "Window"
                if bi is "com.microsoft.entourage" then
                  set winmenuitems to name of every menu item
                  set theindex to 11
                  -- get best guess at main window
                  repeat with i from 11 to (count winmenuitems)
                    if (item i of winmenuitems contains "—") or (item i of winmenuitems begins with "Folders") then
                      set theindex to i
                      exit repeat
                    end if
                  end repeat
                  click menu item theindex
                else if bi is "ws.agile.1Password" then
                  click menu item "Main Window"
                end if
              end tell
            end tell
          end tell
        end tell
      end tell
    on error myerr
      -- log myerr
    end try
  end if
else if bi is "com.apple.itunes" then
  -- special case for itunes :  minimize (mini-player) rather than miniaturize (to dock) the main iTunes window
  tell application "iTunes"
    set minimized of browser window 1 to theval
    activate
  end tell
else
  tell application id bi
    try
      set wins to every window whose closeable is true
      repeat with awin in wins
        try
          if bi is "com.apple.finder" then
            using terms from application "Finder"
              -- finder windows use the property "collapsed" rather than "miniaturized" -- annoying
              if closeable of awin and ((resizable of awin is true) or not requireresizable) and ((theval and visible of awin) or (not theval and (get collapsed of awin) and name of awin is not in exclusions)) and (not windows_must_have_titles or (windows_must_have_titles and name of awin is not "")) then
                try
                  set collapsed of awin to theval
                end try
              end if
            end using terms from
          else
            if closeable of awin and ((resizable of awin is true) or not requireresizable) and ((theval and visible of awin) or (not theval and miniaturized of awin and name of awin is not in exclusions)) and (not windows_must_have_titles or (windows_must_have_titles and name of awin is not "")) then
              try
                set miniaturized of awin to theval
              end try
            end if
          end if
        on error myerr
          -- log if desired
          --log myerr
        end try
      end repeat
    on error myerr
      -- log if desired
      -- log myerr
    end try
    activate
  end tell
end if
Each script can then be attached to a keyboard combo (with a keyboard macro program such as QuicKeys). I have also triggered the scripts with a programmable trackball (using Kensington MouseWorks), so I can perform both actions with the trackball without moving the mouse pointer. (Similar results could be achieved with other mouse drivers, I believe.)

Certain options are definable in the script properties. This script works in many but not all applications, and some workarounds using GUI access scripting were included for MS Entourage and 1Password.

[robg adds: I tested this script in both 10.5 and 10.6, and it works as described in both versions of the OS. As noted, it will not work in all applications.]
  Post a comment  •  Comments (19)  
  • Currently 2.53 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (15 votes cast)
 
[9,009 views]  View Printable Version
Preserve app preferences and settings when using FileVault System
I use FileVault to encrypt the contents of my home folder. In the case of my laptop being stolen or lost, the new user should therefore be unable (or find it extremely hard at least) to access my work and personal confidential data.

FileVault is very powerful, but it has a downside: FileVault loses some of my file associations and related preferences each time I log out, restart, or shutdown. For example, my preferred browser is Firefox, not Safari. Therefore, every time I log in, I have to reset the Firefox to be my 'Default web browser' in the Safari settings dialog.

Since OS X v10.4, this behaviour has been driving me to distraction. This is a known problem, and has been widely reported by FileVault users (see this hint, for instance). I was hoping that this would have been fixed with 10.6.2, but alas, the problem continues. So I set out to solve it.
read more (223 words)   Post a comment  •  Comments (8)  
  • Currently 2.06 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (16 votes cast)
 
[6,508 views]  View Printable Version
An AppleScript to reinstall custom icons after updates System
Like many people, I have customized many thing about my OS X setup, not the least of which were app and folder icons. Via programs like CandyBar or LiteIcon, or manually, any and all folder/file/app icons can be changed.

Personally, I like the pure|icns set from Interfacelift. However, there is a problem when programs update -- in my case, Dropbox -- and change their icons back to a boring old Leopard blue. To return my custom icons, I wrote an AppleScript. Since this only happens every now and then, I didn't make the script executable; I just call it from Google's quick search box whenever I need it.

At any rate, this script will copy an icon from some location (file, folder, *.icns), and paste it via the Get Info window for any second location (file, folder, app) that you desire. Of course, change the first two POSIX paths to (1) where the icon should come from, and (2) where the icon should go.
set newIcon to (POSIX file "/this/is/the/path/to/the/icon") as alias
set theItem to (POSIX file "/this/is/the/path/to/the/location") as alias

tell application "Finder"
  activate
  set infoWindow to open information window of newIcon
  set infoWindowName to name of infoWindow
end tell

tell application "System Events"
  tell application process "Finder"
    tell window infoWindowName
      keystroke tab
      delay 1
      keystroke "c" using command down
    end tell
  end tell
end tell

tell application "Finder"
  close infoWindow
  set infoWindow to open information window of theItem
  set infoWindowName to name of infoWindow
end tell

tell application "System Events"
  tell application process "Finder"
    tell window infoWindowName
      keystroke tab
      delay 1
      keystroke "v" using command down
    end tell
  end tell
end tell

tell application "Finder"
  close infoWindow
end tell
This script contains modified code from this script.

[robg adds: I haven't tested this one.]
  Post a comment  •  Comments (9)  
  • Currently 2.44 / 5
  You rated: 1 / 5 (18 votes cast)
 
[8,739 views]  View Printable Version
Add a Show Desktop icon to the Dock System
Wouldn't it be nice to activate Exposé's Show Desktop mode via an icon on the Dock? Here's how to make one that does just that. However, be warned: this works only one way -- it shows the Desktop, but on clicking again, it does not bring the windows back. To get out of Exposé's Show Desktop mode, just click anywhere along the darkened screen border.
  1. Create an AppleScript application. Open AppleScript Editor (Applications » Utilities » AppleScript Editor in 10.6) and paste in this code:
    (* Show Desktop AppleScript by Mohan Noone, 2009 *)
    activate application "Finder"
    do shell script "/Applications/Utilities/Expose.app/Contents/MacOS/Expose 1"
  2. Save the script, name it something like Show Desktop, set the File Format to Application, and select the Run Only option in the Save dialog.
  3. Optional: change the boring script icon. Select the saved file in Finder and hit Command-I to open the Get Info Window, then do the same for the file with the icon you'd like to use. Then select the better icon from its Get Info Window, copy it (Command-C), select the script icon in the other Get Info window, and paste (Command-V).
  4. Drag the saved file to the Dock.
Your Show Desktop icon is ready for use!

[robg adds: This works in 10.5 and 10.6, at least. For use in 10.5, you'll need to take /Utilities out of the do shell script line. I'm also not sure why you need to activate the Finder first; it seems to work fine for me with just the shell script line. Note that you can activate Exposé's other modes in this manner -- change 1 to 2 and you'll get Exposé's Application Windows mode, and 3 gets you All Windows mode.]
  Post a comment  •  Comments (15)  
  • Currently 2.65 / 5
  You rated: 1 / 5 (23 votes cast)
 
[22,000 views]  View Printable Version
Launch login items via AppleScript to avoid login delays System
I found that most of my startup items were things that I didn't need right away (Google Quick Search Box, LaunchBar, etc.). A simple AppleScript can be used to avoid the pileup of programs all trying to open at once at login. The result: a much faster login time.

The script works by opening programs one by one, with a little time in between. This gives the programs time to load, and allows you to use your computer as soon as you enter your password. The code looks like this:
tell application "Google Notifier" to activate
delay 3
tell application "LaunchBar" to activate
delay 3
set volume 4
tell application "BOINCManager" to activate
tell application "Quick Search Box" to activate
tell application "RealPlayer Downloader Agent" to activate
So, immediately opened is Google Notifier. Shortly thereafter comes LaunchBar. Afterwards, the volume is set to half loudness, and some other programs open.
read more (269 words)   Post a comment  •  Comments (31)  
  • Currently 3.39 / 5
  You rated: 1 / 5 (28 votes cast)
 
[23,627 views]  View Printable Version
One Easy way to transfer files from Boot Camp to OS X System
I use Boot Camp on my Mac, and quite often I create files in Windows and want those files on the OS X side as well. It's a pain to take out a USB flash drive and copy the files there, reboot, and copy them again. If the files are large, emailing the files to yourself may not work either.

One solution is Dropbox. As Dropbox works on OS X, Windows, and Linux, all you have to do is install Dropbox on your Boot Camp Windows installation, then drop or save any files in theree; they will automatically transfer into OS X the next time you boot back into the Mac OS.
  Post a comment  •  Comments (25)  
  • Currently 2.13 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (30 votes cast)
 
[48,118 views]  View Printable Version
Repair a Time Machine error after restoring from Time Machine System
After restoring from a Time Machine backup, I ran into this error when Time Machine then tried to create a new backup:
The backup is too large for the backup volume. xxGB is required but only yyGB is available.
This occurs because Time Machine sees your restored computer as a completely new set of data and is trying to do a full back up. To solve this issue, open the backup drive that Time Machine backs up to, and locate the following file:
computername_0022334455.sparsebundle
Where computername is your computer's name, and 0022334455 is your computer's MAC address. Delete this file and have Time Machine do a new full backup of your system, and this error will disappear.

[robg adds: I've never had to do a full restore from Time Machine, so I haven't seen this error -- if someone else can confirm the problem and the fix, please post in the comments.]
  Post a comment  •  Comments (8)  
  • Currently 1.54 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (13 votes cast)
 
[7,652 views]  View Printable Version
Extract icons using the 'Choose custom image' window System
I was working on a software organizing database in Bento, and I discovered that you can use the 'Choose custom image' window, available in a media field, to extract the icon of an application by dragging and dropping it onto the picture frame. I tested it in Address Book (the only other application I was sure had the same media field) and it worked, too.

In Address Book, for instance, edit a contact, then double-click on the picture field to bring up the custom window for setting that contact's picture. Drag and drop an application into the box, and its icon will appear. Or click the Choose button, and navigate to the Application in the file dialog. Once the icon is there, it can be copied and pasted.

This works in, at the least, 10.5 and 10.6.

[robg adds: While this works, it seems more of a curiosity than anything else -- you can copy any application's icon by just copying the application in the Finder, then opening a new window in Preview. I know we've run that tidbit as a hint before, but I couldn't find it when searching.]
  Post a comment  •  Comments (1)  
  • Currently 1.92 / 5
  You rated: 1 / 5 (13 votes cast)
 
[4,909 views]  View Printable Version
Preserve timestamps when copying from FAT to HFS+ System
Imagine you have made a world tour in August 2009 (summer time!) and you have used your digital photo camera to create pictures, videos and voice recordings.

In this guide I will not refer to these items by their specific characteristics (photo, video, audio), but simply regard all of them as "files." Secondly, we assume that the files are saved on a storage medium, which is very likely formatted as FAT (as specified in the DCIM standard for digital cameras).

You have created three files in America/Los Angeles (UTC-0700), three files in your hometown Europe/Vienna (UTC+0200) and three files in Asia/Bangkok (UTC+0700), and at the end of the summer, you return to your hometown Europe/Vienna.

This guide shows you how to correctly bring your files' timestamps from a local time zone-based file system (such as your external flash drive, formatted as FAT32) to a file system using coordinated universal time (UTC) (such as your internal hard disk, formatted as HFS+) using the Finder on MacOS X.

read more (1,018 words)   Post a comment  •  Comments (6)  
  • Currently 2.56 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (16 votes cast)
 
[8,917 views]  View Printable Version