Re: root user cannot compile NSAppleScript
Re: root user cannot compile NSAppleScript
- Subject: Re: root user cannot compile NSAppleScript
- From: Chris Garaffa <email@hidden>
- Date: Wed, 10 Dec 2003 09:23:29 -0500
On Dec 10, 2003, at 4:04 AM, Lorenzo wrote:
Hi list,
I login on my machine as simple user (administrator) and I run my
application with the root privileges (geteuid() == 0);
It works fine, very fine, except that when I try to compile even a
simple
AppleScript like:
----------------
tell application "Finder"
beep
end tell
----------------
it gives me error -2709
I do this:
as = [[[NSAppleScript alloc] initWithSource:asText] autorelease];
ok = [as compileAndReturnError:&asError];
When I run my application with the root privileges, ok is always NO.
When I run my application as simple user, ok is always YES. It works
all the
time.
What should I do in order to fix the problem?
Have you gone through asError to determine what the problem is?
NSLog(@"%d", [asError objectForKey:@"NSAppleScriptErrorNumber"]);
NSLog([asError objectForKey:@"NSAppleScriptErrorBriefMessage"]);
NSLog([asError objectForKey:@"NSAppleScriptErrorMessage"]);
NSLog(@"%d", [[asError objectForKey:@"NSAppleScriptErrorRange"]
rangeValue]);
And see what that gives you while running as root.
--
Chris Garaffa
email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.