Error code -128

I am trying to make a script that checks to see if the programs I want to be running are or not, and then opens them if they aren't. I then want it to check to see if they are running, and then close them. I plan on putting this on a Quicksilver hotkey, and then having the script run it's functions.

I've got the script working to the point where it opens the applications if they are closed, but when I get to the quitting part, it gives me:

error "LCDManager got an error: User canceled." number -128

I am not sure what I can to do to stop the computer from auto cancelling this?

Here is my script code:


set appName to "LCDManager"
set appNameB to "G-Series Key Profiler"
set quitIt to false
set startIt to false
tell application "System Events"
if not (exists process appName) then
set startIt to true
else if (exists process appName) then
set quitIt to true
end if
end tell
if startIt then
tell application appName to activate
end if
if quitIt then
tell application appNameB to quit
tell application appName to quit
end if


Message was edited by: David Aaron

MacBook Pro 15", Mac OS X (10.6.3)

Posted on Mar 30, 2011 10:51 AM

Reply
3 replies

Mar 30, 2011 1:11 PM in response to David Aaron

There's nothing particularly funky or unusual in your script - at least not that should trigger that error.

Therefore I'd have to assume that the problem lies within the LCDManager application and how it's responding to the quit event.

Does the code:

tell application "LCDManager" to quit


give the same error? if so the problem is within the app. The only hope at that point is that there's some option in the app to change how it responds to the quit command (e.g. with a 'without saving' or similar parameter), but for that you'd need to look at the app's dictionary.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Error code -128

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.