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

abidkhan135

macrumors newbie
Original poster
Apr 1, 2013
9
0
I had coded an applescript that login the user on back end when MAC starts.
NSAppleScript *runscript;

//NSLog(@"comes to applescript");
//////////NEW CODE FROM HERE//////////

NSString *scriptString = @"set username_ to \"Administrator\"\n"
"set password_ to \"vsi9217\"\n"
"tell application \"System Events\"\n"
"key code 125\n"
"key code 125\n"
"delay 1\n"
"key code 125\n"
"key code 125\n"
"key code 125\n"
"key code 125\n"
"key code 125\n"
"key code 125\n"
"delay 0.5\n"
"key code 36\n"
"delay 1\n"
"tell process \"SecurityAgent\" to set value of text field 1 of group 1 of window 1 to username_\n"
"tell process \"SecurityAgent\" to set value of text field 2 of group 1 of window 1 to password_\n"
"click button \"Log In\" of window 1 of application process \"SecurityAgent\"\n"
"end tell\n";

NSLog(@"%@",scriptString);





runscript = [[NSAppleScript alloc] initWithSource:scriptString];

[runscript executeAndReturnError:nil];
[runscript release];
its working fine and perfect on 10.6.x but when i updated my OS to 10.8.3 script is not working . Kindly help.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.