Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

haravikk

macrumors 65832
Original poster
May 1, 2005
1,501
21
Okay, so I know how to prevent all previously open apps from being reopened on restart, but I haven't been able to find out how to prevent this only for specific apps.

You see I have an application that can't actually function properly until a specific volume is available, which usually doesn't appear straight away. So I have a script setup to detect the volume and open the application, however this doesn't help if the app was already reopened.

It's an application that I tend to leave open but hidden so I can quickly switch to it as needed, but I almost never remember to close it before shutting down.

There are various useful tricks for preventing Resume on applications (locking saved state folder and/or specific app state folders) but I haven't figured out where OS X stores the list of open applications to be reopened after restarting. Does anyone know, and if so, know of a way to prevent specific applications form being reopened? I don't mind the feature in general, so I don't want to disable it completely.
 

haravikk

macrumors 65832
Original poster
May 1, 2005
1,501
21
I could, but that doesn't prevent the application from opening with its files unavailable, which causes it to discard all cached data and to throw up its setup wizard, which is all quite disruptive.
 

Weaselboy

Moderator
Staff member
Jan 23, 2005
34,482
16,197
California
I could, but that doesn't prevent the application from opening with its files unavailable, which causes it to discard all cached data and to throw up its setup wizard, which is all quite disruptive.

Ah I see....

It looks like this is managed by a plist file at Library > Preferences > ByHost > com.apple.loginwindow.[xxxxxxxxx].plist

Not sure if you can manipulate it to do what you want though.
 

haravikk

macrumors 65832
Original poster
May 1, 2005
1,501
21
It looks like this is managed by a plist file at Library > Preferences > ByHost > com.apple.loginwindow.[xxxxxxxxx].plist

Not sure if you can manipulate it to do what you want though.
Hmm, is it possible to setup a script to run on shutdown? If so then I could either close the app and see if it keeps it out of that file, or alternatively use a shut-down script to remove the app from the file, as the structure is fairly simple so it shouldn't be hard to edit.
 

Weaselboy

Moderator
Staff member
Jan 23, 2005
34,482
16,197
California
Hmm, is it possible to setup a script to run on shutdown? If so then I could either close the app and see if it keeps it out of that file, or alternatively use a shut-down script to remove the app from the file, as the structure is fairly simple so it shouldn't be hard to edit.

I use this script to shutdown. You could run a line at the start of this script to quit your app like I added here. Just put your app_name in there. That might work for you.

Code:
tell application "app_name"
    quit
end tell
tell application "System Events"
	tell process "Finder"
		click menu item "Restart" of menu "Apple" of menu bar 1
	end tell
end tell
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.