I have the same double document opening behavior. I scanned this thread quickly so forgive me if this was already mentioned, but if I turn off “Reopen projects that were open on quit” in the preferences then the double document opening behavior (when doubling clicking on a Scrivener file to open the project/app) does not happen (though the Project Templates window does still open).
Yes, you’re right, MatthewB. Which about wraps it up, really. If like me you want to launch directly from projects, turn off this pref. I can’t remember now whether it’s turned off by default or not, but if not I’m wondering whether maybe it should be to avoid this confusion.
You can also get rid of the Templates window by turning off the ‘Show start panel when there are no projects open’ pref. However, this means that it won’t show up either when you launch from the app icon.
It seems at the moment that this window opens before the app has worked out whether to open a project or not. If this was fixed, then the pref could be turned on with no problem.
This is really strange… This shouldn’t happen at all. When you double-click a project to open it, Scrivener shouldn’t then go and open the other projects automatically. It’s set up explicitly not to do that. Obviously I’ve tried exactly what you are doing and it has been tested - so this is very odd indeed.
Could anyone experiencing this problem please download the following version of Scrivener:
literatureandlatte.com/downl … enTest.zip
Please note: this build will [b]not[/i] fix the problem. Instead, it is intended to give me more information. Please do the following:
-
Download and install this version.
-
Double-click to open a file in the Finder so that you see the strange double-opening behaviour.
-
Open Console.app from your ~/Applications/Utilities/ folder.
-
Type “Scrivener” in the search field in the Console toolbar.
-
Look for messages pertaining to Scrivener on the console, and copy and paste all of them into this thread. (They should say things like “application:openFile called” and “about to open recent files?..”)
This will hopefully give me more to go on.
Also, you are all double-clicking on the file in the Finder, right, and not some Finder replacement such as Path Finder? And do you have any helpers installed on your systems that might be a factor?
Thanks,
Keith
Keith -
Did that - with same weirdness as ever - and here’s what Console gives me, as per your instructions:
11/5/10 7:07:45 PM Scrivener[479] application:openFile: called…
11/5/10 7:07:45 PM Scrivener[479] ***** Opening: /Users/malcolm/Documents/Writing/Projects in Progress/The Chaos Thread/Chaos Thread.scriv…
11/5/10 7:07:48 PM Scrivener[479] About to open recent files? YES
11/5/10 7:07:48 PM Scrivener[479] *** Go ahead and open recent files!
11/5/10 7:07:56 PM Scrivener[479] **** new doc: <SCRMainDocument: 0x81fc00> (error: (null))
11/5/10 7:07:56 PM Scrivener[479] **** Should open recent files? NO
Here’s hoping that tells you something useful. I don’t have any Finder add-ons that I’m aware of. I did have, one called TotalFinder, which simply gives you tabs and a possible double view in Finder windows, but I removed it and rebooted and the problem persisted. I’m not aware of any other likely culprits, and wouldn’t really know what to look out for apart from obvious Finder add-ons like this. But I do have a lot of stuff on my system, but avoid haxies and such like the plague. I’m not having any similar problems with any other apps.
Maybe I should add that with the ‘Reopen projects that were open on quit’ pref turned off, the problem goes away. The template window does open, though - unless I turn off the ‘Show start panel when there no projects open’ pref as well.
Best,
Malcolm
Eek! Yes, that’s very helpful, and now I know how to fix it, thank you. I’ll give you the technical explanation, but feel free to glaze over:
When a Cocoa application launches, it receives a message to one of the parts of the program: “applicationDidFinishLaunching”. It is in this part of the code that Scrivener reopens the most recent projects.
However, if a user launches the application by double-clicking on a file in the Finder, the program is guaranteed to first receive the message “application:openFile:” - this will always come before “applicationDidFinishLaunching”, according to the Cocoa documentation. So if this gets called, Scrivener opens the project and then saves some information that allows the “applicationDidFinishLaunching” bit of the code - which should always come after - to know that it should not open any existing projects, because a project has been opened by double-clicking.
From your console report, “application:openFile:” has indeed been called first as guaranteed, but then “applicationDidFinishLaunching” has got called before “application:openFile:” has run all the way, through, and before Scrivener has made a note that it shouldn’t open any recent projects.
I have no idea why on some machines, for some users, “applicationDidFinishLaunching” gets called earlier - although it is clearly during the opening of the project itself - but the fix should be easy enough - I just have to record the information that it shouldn’t open recent projects a little earlier. Very strange that no one reported this with 1.x, as the code hasn’t changed, but that’s what’s happening according to your console report.
So, many thanks for posting this. I’ll try to upload a fix you can test out tomorrow.
Thanks again!
All the best,
Keith
Right, please download this version:
literatureandlatte.com/downl … penFix.zip
Based on the information mcoad provided (thanks!), this should fix the issue. Let me know how it goes.
Thanks,
Keith
Are the updated versions you post in response to threads like this mirrored into the main download Keith, or do you save them up and only update it every so often?
The obsessive Scrivener compulsive in me urges me to search for, and obtain the various incremental updates but I have a feeling it’s probably unnecessary unless my workflow affected by a specific issue that one of them addresses!
Eddy
These ones are mainly for testing fixes, so don’t worry about them too much - although they won’t hurt. I’ll update Scrivener with all of these fixes properly soon.
Thanks,
Keith
Hey Keith
A few of things about this bug:
• It certainly is “not your fault”—I safe booted my computer, and I could not get the bug to replicate. As soon as I normal-booted, it came back. I could try to test which extension is causing this (the most likely culprits are Default Folder or Keyboard Maestro), but have not (that is really tedious!)
• I downloaded the DblOpenTest version and got substantially the same messages in Console as mcoad.
• I downloaded the DblOpenFix version AND IT DID NOT FIX THE PROBLEM. However, I wonder if you linked to the right version. When I unzip the DblOpenFix version I get a NaNoWriMo splash screen, and Get Info it says “2.0b NaNoWriMo 2010 Preview” with a date of 2:33 on October 26
I’m going back to the previous (distribution) version.
Cheers
A
D’oh! Oops, yes, I zipped it up from completely the wrong “Release” folder, sorry about that. You did indeed just download the two-week-old NaNo version, and NOT the fix. Here’s the correct version, which should fix it:
Okay, the version from the 11:19 am post did the trick. Double clicking on a Scrivener file to open Scrivener does not result in two copies being opened. I can also turn the “Reopen projects that were open on quit” back on and the behavior is as it should be. Thanks for the fix!
Glad it helped! Thanks for the reports that helped me find and fix this.
Best,
Keith
Apologies for going AWOL for a few hours. Yep, the fix does the trick. All is now hunkydory and perfecto. Many thanks for this, Keith, and much kudos for the dedication. It only confirms just what a fine developer you are, and what a superb programme Scrivener is. Here’s hoping you manage to get a few hours rest - not to mention a few of those pints - over the weekend.
Thanks for the full technical explanation above, btw. I’m no tech, but it’s good to have it and to learn as a result…
Very best,
Malcolm
Thanks for the kind words, and I’m glad it fixed things. It was a bad assumption in the code on my part, basically, but fortunately it was a simple fix once I could see where it was happening, so thank for bringing it to my attention.
And don’t tell vic-k because he already thinks I’m a “dipso”, but it’s definitely beer o’clock here now.
Thanks and all the best,
Keith