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

MitchBall

macrumors newbie
Original poster
Sep 15, 2014
2
0
I have searched everywhere for how to set up login items and ran different scripts in terminal, applescript, and xcode.

However none have seemed to work, what needs to be done is a global login item needs to run a .app file which maps 2 network drives, and another .app which runs printer software, however none of the scripts i have used have worked.

If anyone could provide a link, or code, or any help or how to, it would be highly appreciated.

Thanks!
 
http://www.macinstruct.com/node/427

https://forums.macrumors.com/threads/1010342/

http://stackoverflow.com/questions/9483959/osx-10-8-loginitems

Also; I have tried codes such as -

Code:
-(void) addAppAsLoginItem{
	NSString * appPath = [[NSBundle mainBundle] bundlePath];

	// This will retrieve the path for the application
	// For example, /Applications/test.app
	CFURLRef url = (CFURLRef)[NSURL fileURLWithPath:appPath]; 

	// Create a reference to the shared file list.
        // We are adding it to the current user only.
        // If we want to add it all users, use
        // kLSSharedFileListGlobalLoginItems instead of 
        //kLSSharedFileListSessionLoginItems
	LSSharedFileListRef loginItems = LSSharedFileListCreate(NULL,
                                                     kLSSharedFileListSessionLoginItems, NULL);
	if (loginItems) {
		//Insert an item to the list.
		LSSharedFileListItemRef item = LSSharedFileListInsertItemURL(loginItems,
                                                     kLSSharedFileListItemLast, NULL, NULL,
                                                     url, NULL, NULL);
		if (item){
			CFRelease(item);
                }
	}	

	CFRelease(loginItems);
}


Nothing Still seems to work, we are trying to run this in a school for users to log on and have all drives ready for use, we are running OS X 10.9.4.

Thanks in advance.
 
Last edited by a moderator:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.