Disable OSX Mavericks' "Do you want to try to reopen its windows again?" popup - osx-mavericks

I'm using OSX's launchctrl functionality to automatically relaunch an app after it crashes.
Unfortunately, when the app relaunches, it launches together with an action window that reads:
"The last time you opened MyAppName, it unexpectedly quit while reopening windows. Do you want to try to reopen its windows again?"
I tried to suppress it by calling NSQuitAlwaysKeepWindows
defaults write -app /Path/to/app/MyAppName.app NSQuitAlwaysKeepsWindows -bool false
But this only works some of the time - I'd say that the popup window launches 50% of the time.
This window requires action and blocks the app from jumping into a full screen mode.
I'm on OSX 10.8.4
Thanks for any ideas ...
Jeremy

Open the folder "~/Library/Saved Application State" and look for a file like "some.url.MyAppName.savedState".
Deleting this file might probably solve the problem, at least it worked for me.

I was able to fix mine by deleting the Envelope Index file(All the files with the name "Envelope Index") under /Library/Mail/V2/MailData folder.
Then restart the mac.

Related

MacOS desktop background won’t change

I was playing around with a python script that downloads and changes the wallpaper, and suddenly the wallpaper went black and won’t change even through the preferences menu. The dock also stopped working and I am no longer able to switch apps using cmd + tab.
I tried restarting the computer, resetting the PRAM, deleting both the com.apple.finder.plist and the com.apple.desktop.plist files, and running a defaults write com.apple.finder CreateDesktop true; killall Finder command. If I run a killall Dock it says they there are no Dock processes running.
The python script I was playing with was just running a simple osascript:
/usr/bin/osascript<<END
tell application "Finder"
set desktop picture to POSIX file "%s"
end tell
Nothing worked. Any ideas on how I could fix this problem? Im on Monterey.
I found a solution. It was hidden in a comment on another similarly related stack overflow question here.
As described by one of the comments, the problem happened after trying to set a malformed image file as my background. I followed the suggested step to delete my ~/Library/Application Support/Dock directory, which solved the problem instantly.

Get rid of "Do you want to try to reopen its windows again?" dialogs

I'm building a Cocoa application with Xcode. I have to force-kill my app for unrelated reasons, and every time I do I get this popup:
The last time you opened MyApp, it unexpectedly quit while reopening windows. Do you want to try to reopen its windows again?
If you choose not to reopen windows, you may have to open and position the windows yourself.
[Don't Reopen] [Reopen]
What is this system called and how can I disable it for my application?
This is Cocoa's automatic state restoration in action. You can suppress it when your app is launched under Xcode by editing your active scheme, choosing the Run action, and checking "Launch application without state restoration".
Note: Disabling this will also disable automatically-reopening documents that were opened previously, which can be a pain for testing a document-based application, since you'll have to re-open the doc manually each time you run it. This also only disables state restoration while being run under Xcode under that particular scheme.

Replaced Finder kiosk

I am trying to make a kiosk, I actually wanted to lauch my app before the Finder got launched, I wrote the following command:
defaults write com.apple.loginwindow Finder ~/Desktop/myapp.app
and it worked, but now I have a huge issue, my Finder wont get launched at all, instead everytime my application is launched when I press the Finder, Before I was getting erroR -10810 but I fixed that. I tried reversing the process but it isnt working. My mac is useless and I cant get to my files.
Target is to reverse the process and make my finder works again as normal

mac stuck while re-installing xcode?

I recently had a problem with Xcode 3.2.6 and decided to reinstall it. I tried to uninstall the previous one before but wasn't able to. The instructions said to run a line in a terminal window but I kept getting the message that Xcode was not found. Anyway, I decided to do a not-so-clean reinstallation and clicked on the dmg to install it.
Everything went fine until now, there is a message that reads
"running package scripts"
"install time remaining: 2 min"
it has been like this for the last 20 minutes!!!!!! what should I do?????? should I force it to quit with activity monitor? should I wait longer?
HELP PLEASE!!!!!
Actually, I know now what happened... during the installation process it asked me to close iTunes, which I did, but the window asking for it remained opened. It occurred to me to check if there was something else from iTunes opened in the activity monitor, and there was! iTunes has an "iTunes helper" that opens automatically and doesn't close when you close iTunes. I forced the helper to quit and that unblocked the installation process!

Unable to install Xcode on Mac OS X Lion (10.7) [duplicate]

I am trying to install Xcode 4.1 GM on my Lion mac but it's not working. When it is almost finished, I get the popup to quit iTunes even though it is already quit. So the only option I have is to quit iTunes helper or alert in activity monitor, then it finishes the install. However then Xcode crashes on launch. Any ideas?
You can go into Activity Monitor and Quit the iTunes helper. That will also get Xcode to finish.
Looks like you've solved the install problem. It's not a solution per se, but setting Xcode to run in 32-bit mode fixed the crashing problem for me.
It's too early to say what the trade-off is (if any), but whatever it is, it's bound to be better than not being able to use it at all.
On a side note: please accept Phil's answer since he gave the correct solution to your original problem. C:
if you boot into single user mode (Press S when starting up), the installation works as it should. Xcode will then function without switching it to 32-bit mode.
Open "Activity Monitor" (press Command+Space to bring up spotlight, or find it in Applications.)
Sort by Process Name and find the process called "iTunesHelper".
From the "View" menu choose "Quit Process".
Then click on the "Force Quit" button. Xcode installation should continue now.
Try to use the xCode through the Finder after you get this problem. It happened to me, but I can still run the xCode.
I think it's something to do with your version of itunes is more updated than your Mac Os version.

Resources