Search code examples
objective-capplescriptmacos-carboncore-foundationfinder

my system refuses to shut down/restart with NSAppleScript class


I am using CFPlugin for contextual menu and icon overlay on 10.5(same as scplugin). For communication between my application and finder , i am using distributed object. After installing my plugin inside Contextual menu items folder , my system refuse to restart/shutdow/Logout. In activity monitor i am unable to quit finder , only force quit is woking for finder. On console I am getting on 10.5.8

ERROR | -[ApplicationManager(AppleEventHandling) _tryQuitAllForRequestor:replyEvent:] | _tryQuitAllForRequestor - _vproc_set_global_on_demand returned error -1805620379  

Without communication between Finder and my application, system restart/shutdow/Logout are working fine.
On 10.5.4

loginwindow[41]: ERROR | WSActivateApp | SetFrontProcess({0, 7980956}) returned error -600. Unable to activate process.

loginwindow[41]: ERROR | -[ApplicationManager(AppleEventHandling) _tryQuitAllForRequestor:replyEvent:] | _tryQuitAllForRequestor - _vproc_set_global_on_demand returned error -1780878507

Can anyone please help me out?

EDIT

My problem is solved. I was using NSAppleScript for executing apple script. Now i am using NSTask and my system restart/shutdow/Logout are working fine. can anyone please explain me reason for this?


Solution

  • My problem is solved. I was using NSAppleScript for executing apple script. Now i am using NSTask and my system restart/shutdow/Logout are working fine