Mac OS X: finder window keeps opening by itself and stealing focus

31
2013-08
  • Halfgaar

    I have a Macbook with Mac OS X 10.4.11 here, with an annoying problem. After starting the computer and logging in, the finder keeps stealing focus. You can go back to your working app, but a minute later, it steals focus again. Even as I'm typing this message, I had to reslect firefox two times.

    At some point it stops, but how often it pops up/steals focus first is kind of random, it seems.

    The finder menu at the top of the screen also flickers sometimes when it does that, so it seems it's not just the window that opens, but that finder completely restarts. (the behavior is the same when I press shift-command click, and then restart the finder).

    Can anyone point me in the right direction? I already looked under startup items in accounts/login, but that all seems normal. I also removed com.apple.finder.plist, as was suggested somewhere.

    edit: Upon examination, it seemed that finder kept crashing. Here is a crashlog:

    Host Name: monster Date/Time: 2010-07-15 10:42:01.318 +0200 OS Version: 10.4.11 (Build 8S2167) Report Version: 4

    Command: Finder Path: /System/Library/CoreServices/Finder.app/Contents/MacOS/Finder Parent: WindowServer [61]

    Version: 10.4.7 (10.4.7) Build Version: 3 Project Name: Finder_FE Source Version: 5292900

    PID: 231 Thread: 3

    Exception: EXC_BAD_INSTRUCTION (0x0002) Code[0]: 0x0000000d Code[1]: 0x00000000

    Thread 0: 0 libSystem.B.dylib 0x9fe48cd7 mach_msg_trap + 7 1 com.apple.CoreFoundation 0x9082d227 CFRunLoopRunSpecific + 2014 2 com.apple.CoreFoundation 0x9082ca42 CFRunLoopRunInMode + 61 3 com.apple.HIToolbox 0x92df1878 RunCurrentEventLoopInMode + 285 4 com.apple.HIToolbox 0x92df0f82 ReceiveNextEventCommon + 385 5 com.apple.HIToolbox 0x92e39a74 _AcquireNextEvent + 58 6 com.apple.HIToolbox 0x92e398bc RunApplicationEventLoop + 150 7 com.apple.finder 0x00007deb 0x1000 + 28139 8 com.apple.finder 0x00004c6b 0x1000 + 15467 9 com.apple.finder 0x000515b6 0x1000 + 329142 10 com.apple.finder 0x000514dd 0x1000 + 328925

    Thread 1: 0 libSystem.B.dylib 0x9fe65d5c kevent + 12 1 ...ple.CoreServices.CarbonCore 0x90cb8d0c PrivateMPEntryPoint + 51 2 libSystem.B.dylib 0x9fe63227 _pthread_body + 84

    Thread 2: 0 libSystem.B.dylib 0x9fe638c7 semaphore_wait_signal_trap + 7 1 ...ple.CoreServices.CarbonCore 0x90cb8eb2 MPWaitOnQueue + 198 2 com.apple.DesktopServices 0x9271f943 TNodeSyncTask::SyncTaskProc(void*) + 143 3 ...ple.CoreServices.CarbonCore 0x90cb8d0c PrivateMPEntryPoint + 51 4 libSystem.B.dylib 0x9fe63227 _pthread_body + 84

    Thread 3 Crashed: 0 <<00000000>> 0x90024689 0 + -1878899063

    Thread 3 crashed with X86 Thread State (32-bit): eax: 0x017ca000 ebx: 0x017ce977 ecx: 0x00000000 edx: 0x017ce9c1 edi: 0xffffffff esi: 0xffffffff ebp: 0x017cbff8 esp: 0x017cbf9c ss: 0x0000001f efl: 0x00010296 eip: 0x90024689 cs: 0x00000017 ds: 0x0000001f es: 0x0000001f fs: 0x00000000 gs: 0x00000000

    Binary Images Description: 0x1000 - 0x2ccfff com.apple.finder 10.4.7 /System/Library/CoreServices/Finder.app/Contents/MacOS/Finder 0x5b5000 - 0x5b6fff com.apple.textencoding.unicode 2.1 /System/Library/TextEncodings/Unicode Encodings.bundle/Contents/MacOS/Unicode Encodings 0x14f01000 - 0x14f6efff com.DivXInc.DivXDecoder 6.6.0 /Library/QuickTime/DivX Decoder.component/Contents/MacOS/DivX Decoder 0x8fe00000 - 0x8fe4afff dyld 46.16 /usr/lib/dyld 0x90000000 - 0x90016fff com.apple.CoreVideo 1.4.2 /System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo 0x9002a000 - 0x90348fff com.apple.QuickTime 7.6.0 (1290) /System/Library/Frameworks/Qu

  • Answers
  • Arjan
    • Peek into the log files: see Applications, Utilities, Console.

    • Though removing your current account's Finder's plist didn't help, maybe create a new account to see if things are the same for a fresh user? System Preferences, System, Accounts.

    • Check the digital signature of Finder. Copy the first line into Applications, Utilities, Terminal:

      codesign --verify -vv /System/Library/CoreServices/Finder.app

      ...which (on 10.6.3, maybe this is not present on 10.4 yet?) should give you:

      /System/Library/CoreServices/Finder.app: valid on disk /System/Library/CoreServices/Finder.app: satisfies its Designated Requirement

    • Enable the "Quit Finder" menu option and quit Finder. Finder should then only (automatically) come back if you stop all other applications as well. Does it still come back while you're using your browser? (Quitting Finder will also temporarily hide your Desktop. No worries!)

  • Chris Johnsen

    If it is Finder that is crashing, you should see fresh crash logs in ~/Library/Logs/CrashReporter/Finder.crash.log. You can use the Console application (/Applications/Utilities/Console.app) to view the file.

    The stack traces from such crashes might give you a clue as to why it is crashing.

    If the crashes consistently indicate some third-party code (e.g. a “haxie” or similar “injected” code), then you might try quiting/uninstalling whatever application is injecting the code.

    If you are also seeing crashes of various other applications, it might be a hardware problem (i.e. bad memory). You could also check /var/log/system.log (system.log in Console) for things like disk I/O errors, etc.

  • Halfgaar

    After googling some more, I found a lot of different reasons for this crash and one of which fixed it for me.

    I updated quicktime and the problem seems to be gone.


  • Related Question

    osx - Create a symbolic link in the Mac OS X Finder
  • Michael Schneider

    Is there a way to get the same functionality as the unix command ln -s in the Mac OS X Finder (OS 10.5)? I want to be able to create symbolic links while working in Finder windows without opening the Terminal.

    Note that the Make Alias command in Finder is not what I want because those aliases cannot be navigated in the Terminal (but links created with ln -s can be navigated by both the Terminal and Finder).


  • Related Answers
  • Cawas

    What about that creating symbolic links in the Finder via AppleScript ?

    Here's the most relevant script in that link:

    on run
        open {choose file with prompt "Choose a file to create a symbolic link:" without invisibles}
    end run
    
    on open the_files
        repeat with i from 1 to (count the_files)
            try
                set posix_path to POSIX path of (item i of the_files)
                if posix_path ends with "/" then set posix_path to text 1 thru -2 of posix_path
                do shell script "ln -s " & quoted form of posix_path & " " & quoted form of (posix_path & ".sym")
            end try
        end repeat
    end open
    

    Just paste it into AppleScript Editor and save it as an application. Then you can drag it over your finder's toolbar or link it on the dock.

  • 8088

    SymbolicLinker will do exactly what you're looking for, and it's free.

    alt text

  • Michael Schneider

    An applescript at the link provided by user nuc answered my question. Here is the applescript reproduced in case that link disappears.

    I preferred the script given by the commenter jonn8n, which was also reproduced as Macworld article.

    on run
        open {choose file with prompt ¬
        	"Choose a file to create a symbolic link:" without invisibles}
    end run
    on open the_files
        repeat with i from 1 to (count the_files)
        	try
        		set posix_path to POSIX path of (item i of the_files)
        		if posix_path ends with "/" then set posix_path to ¬
        			text 1 thru -2 of posix_path
        		do shell script "ln -s " & quoted form of posix_path ¬
        			& " " & quoted form of (posix_path & ".sym")
        	end try
        end repeat
    end open
    

    I saved this as an application using Script Editor and dragged the application to the Finder sidebar so I can now create symbolic links by dragging files or folders onto the application icon.

  • Khaled Kammar

    Path Finder adds this to your Finder, and adds a lot more features.

  • Benjamin Dobson

    A possible improvement on this script would be changing the run handler to use the currently selected files from the Finder, as so:

    on run
        tell application "Finder" to set sel to selection
        open sel
    end run
    on open the_files
        repeat with i from 1 to (count the_files)
        	try
        		set posix_path to POSIX path of (item i of the_files as alias)
        		if posix_path ends with "/" then set posix_path to ¬
        			text 1 thru -2 of posix_path
        		try
        			do shell script "ln -s " & quoted form of posix_path ¬
        				& " " & quoted form of (posix_path & ".sym")
        		on error
        			try
        				do shell script "ln -s " & quoted form of posix_path ¬
        					& " " & quoted form of (posix_path & ".sym") with administrator privileges
    
        			end try
        		end try
        	end try
        end repeat
    end open
    

    You could also edit [application]/Contents/Info.plist to add

    <key>LSUIElement</key>
    <true/>
    

    Just before the last </dict>. This would mean the app would run in the background, and wouldn't come to the front when you clicked on it.

  • beiju

    Also, in Snow Leopard where SymbolicLinker doesn't work, you can create a Service with Automator to do either the Terminal command or AppleScript to create a symbolic link.

  • Lauri Ranta

    One more AS:

    tell application "Finder"
        repeat with f in (get selection)
            set p to POSIX path of (f as text)
            set p2 to POSIX path of (desktop as text) & name of f
            do shell script "ln -s " & quoted form of p & " " & quoted form of p2
        end repeat
    end tell
    
  • Ben G

    Try looking here : http://www.techiecorner.com/528/how-to-create-shortcut-in-mac-os-x/

    This is built into OSX already if you press the control key when you click on something.