TF won't launch at system startup when in System Pref Login Items

Version 1.4.18 OS X 10.8.4
Will launch ok from Finder but fails when in System Preferences Login Items.

Please try to look into Console.app and see if there are some errors related to Finder, TotalFinder or TotalFinderInjector.

When started via login items, console messages are:

8/3/13 8:47:33.293 AM TotalFinder[176]: agent started
8/3/13 8:47:33.299 AM TotalFinder[176]: Finder is not running. Launching it...

but is never “successfully injected”. Here is the manual start-up via double click of app:

8/3/13 11:28:55.732 AM TotalFinder[176]: requesting injection into com.apple.finder[142]
8/3/13 11:28:55.759 AM Finder[142]: TotalFinderInjector v1.4.18 received init event
8/3/13 11:28:55.849 AM Finder[142]: TotalFinderInjector: Installing TotalFinder ...
8/3/13 11:28:55.864 AM Finder[142]: Launching TotalFinderCrashWatcher from '/Library/ScriptingAdditions/TotalFinder.osax/Contents/Resources/TotalFinder.bundle/Contents/Resources/TotalFinderCrashWatcher.app'
8/3/13 11:28:55.895 AM TotalFinder[176]: TotalFinder has been succesfully injected into com.apple.finder[142]
8/3/13 11:28:55.920 AM TotalFinderCrashWatcher[1534]: Watching '/Users/brians/Library/Logs/DiagnosticReports' for recent crash reports with prefix 'Finder'

There is one other console message in that time frame:

8/3/13 8:47:33.230 AM coreservicesd[66]: Can't change an application into stopped state for app App:"Finder" [ 0x0/0xa00a]  @ 0x0x7fc66046aa50 because it's already been started.
8/3/13 8:47:33.293 AM TotalFinder[176]: agent started
8/3/13 8:47:33.299 AM TotalFinder[176]: Finder is not running. Launching it...

Interesting… It looks like Finder.app is not fully running during TotalFinder.app launch. But TotalFinder.app injector should know how to deal with this situation… hmm.

Please in Terminal.app execute this line:

touch ~/.debug-totalfinder-injection

Please repeat whole process. I think logging out and in again should do the job, but maybe you could restart whole machine to be 100% sure to reproduce it exactly.

Console.app should now contain much more diagnostics info.

Did the touch to create the invisible file. Here are the log contents after shutdown and restart. This time it worked.( Hmm)
8/3/13 12:31:02.385 PM TotalFinder[180]: ============================================================
8/3/13 12:31:02.401 PM TotalFinder[180]: agent started
8/3/13 12:31:02.402 PM TotalFinder[180]: called injectIntoRunningFinder
8/3/13 12:31:02.665 PM TotalFinder[180]: requesting injection into com.apple.finder[141]
8/3/13 12:31:02.665 PM TotalFinder[180]: --------------
8/3/13 12:31:02.672 PM TotalFinder[180]: tryInjectTotalFinder into <NSRunningApplication: 0x7fa79d500dd0 (com.apple.finder - 141)>
8/3/13 12:31:02.711 PM TotalFinder[180]: start injection timer
8/3/13 12:31:02.735 PM TotalFinder[180]: trying to acquire TotalFinder lock
8/3/13 12:31:02.767 PM TotalFinder[180]: sending injection events to Finder[141] (trial #1)
8/3/13 12:31:02.953 PM Finder[141]: TotalFinderInjector v1.4.18 received init event
8/3/13 12:31:03.589 PM TotalFinder[180]: applicationLaunched:<NSRunningApplication: 0x7fa79d500f40 (com.brianstevens.ccnx - 176)>
8/3/13 12:31:03.590 PM TotalFinder[180]: not Finder (com.brianstevens.ccnx != com.apple.finder) => bail out
8/3/13 12:31:04.441 PM Finder[141]: TotalFinderInjector: Installing TotalFinder …
8/3/13 12:31:04.735 PM TotalFinder[180]: trying to acquire TotalFinder lock
8/3/13 12:31:04.803 PM TotalFinder[180]: already injected - nothing to do
8/3/13 12:31:04.803 PM TotalFinder[180]: stop injection timer
8/3/13 12:31:04.821 PM Finder[141]: Launching TotalFinderCrashWatcher from '/Library/ScriptingAdditions/TotalFinder.osax/Contents/Resources/TotalFinder.bundle/Contents/Resources/TotalFinderCrashWatcher.app’
8/3/13 12:31:04.872 PM TotalFinder[180]: TotalFinder has been succesfully injected into com.apple.finder[141]
8/3/13 12:31:04.873 PM TotalFinder[180]: stop injection timer
8/3/13 12:31:04.886 PM TotalFinder[180]: prevent injection into future launched Finder instances
8/3/13 12:31:04.886 PM TotalFinder[180]: --------------
8/3/13 12:31:05.198 PM TotalFinderCrashWatcher[191]: Watching ‘/Users/brians/Library/Logs/DiagnosticReports’ for recent crash reports with prefix 'Finder’
8/3/13 12:31:40.702 PM TotalFinder[180]: applicationLaunched:<NSRunningApplication: 0x7fa79b2088f0 (com.apple.Console - 229)>
8/3/13 12:31:40.702 PM TotalFinder[180]: not Finder (com.apple.Console != com.apple.finder) => bail out

It looks like a timing issue. Definitely bug in my code.

I just looked at the code and I think I can send you a new build with one thing changed.

I think what happens is that Finder.app is not available during TotalFinder.app launch, TotalFinder.app tries to launch it, but never gets notification about real Finder launch.

I will try to fix it now and send you a zip with new TotalFinder.app.

Please try this new build of TotalFinder.app:
http://dl.dropbox.com/u/559047/TotalFinder-Agent.zip

Also don’t forget to remove that hidden debug file before trying again:

rm ~/.debug-totalfinder-injection

Removed the invisible file and restarted with the new build of TF. It worked. Apparently it was a timing problem and the kicking in debug code with NSLogs() changed it. I’ll watch it report anything unusual. Thanks! Brian

8/3/13 1:39:11.144 PM TotalFinder[174]: Finder is still being launched. Waiting 10 more secs before checking it again.
8/3/13 1:39:21.145 PM TotalFinder[174]: Finder is still being launched. Giving up. Please launch TotalFinder.app manually or contact support@binaryage.com.
8/3/13 1:39:21.147 PM TotalFinder[174]: requesting injection into com.apple.finder[142]
8/3/13 1:39:21.152 PM Finder[142]: TotalFinderInjector v1.4.18 received init event
8/3/13 1:39:21.157 PM Finder[142]: TotalFinderInjector: Installing TotalFinder …
8/3/13 1:39:21.158 PM Finder[142]: Launching TotalFinderCrashWatcher from '/Library/ScriptingAdditions/TotalFinder.osax/Contents/Resources/TotalFinder.bundle/Contents/Resources/TotalFinderCrashWatcher.app’
8/3/13 1:39:21.185 PM TotalFinder[174]: TotalFinder has been succesfully injected into com.apple.finder[142]
8/3/13 1:39:21.197 PM TotalFinderCrashWatcher[216]: Watching ‘/Users/brians/Library/Logs/DiagnosticReports’ for recent crash reports with prefix ‘Finder’

Great. Thank you for good feedback.

But still it looks like 14s total waiting time is not enough on your machine. I will improve that code to be more general and wait longer.

Yes, saw those messages too. FWIW there are 5 apps in my user start-ups. Look forward to any improvement. Even though TF launches like it should, the desktop and regular Finder are available for 5 seconds or so before TF finally shows up in the menu bar. Not a problem for me but thought you might want to know.
Thanks again for the help. I’m not running Mavericks( or I’d offer to beta your new code ) because I prefer development on the current OS release and my products allow me to do that.

2 Likes