• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: root user cannot compile NSAppleScript
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >root user cannot compile NSAppleScript (From: Lorenzo <email@hidden>)

  • Prev by Date: Re: Xcode style deployment: debug-symbols?
  • Next by Date: Re: Issues with multithreaded drawing in Cocoa?
  • Previous by thread: root user cannot compile NSAppleScript
  • Next by thread: Strange Error: "NSApplication Creating more than one Application"
  • Index(es):
    • Date
    • Thread