Thursday, December 14, 2017

#1 2006-04-24 06:59:54 am

iPenguin
Member
Registered: 2006-04-24
Posts: 6

NSReceiverEvaluationScriptError: 4 (1) ?

Hello,

I'm sorry if this has been covered before, or if this isn't the proper place to ask this, but I couldn't find anything on these forums or on the web that answered my question.

Basically, every Applescript studio app that I open gives me a a dialog saying "NSReceiverEvaluationScriptError: 4 (1)".  Sometimes it pops up right away and the the applications main window never shows up, or sometimes it happens when I push a button. All of these apps used to work fine for me, but now they're all a pain to use (some I can't use at all since the app window never appears...).

In my search for an answer I found that a.) it might have something to do with Enabling Access for assistive devices, this is already enabled however, and other (non AppleScript) apps are accessing it fine, or b.) that something changed in the way applescript reports errors, so what was before a silent error now pops up a NSEvaluation error. That might mean that the problem is on the developers' end, but I kinda doubt that, because, like I said, every Applescript App that I've tried has popped up this message...

Does anyone have any ideas about what might be happening? Any help would be nice.

Thanks.

Offline

 

#2 2006-04-24 07:24:59 am

Mikey-San
Member
Registered: 2005-07-13
Posts: 509

Re: NSReceiverEvaluationScriptError: 4 (1) ?

NSReceiverEvaluationScriptError is a constant that refers to a mis-referenced object somewhere. For example, if you're trying to talk to an NSTextField named "textField", but you're mistakenly calling it "myTextField". Another common mistake is to mis-reference the container hierarchy of an object:

Applescript:

set contents of text field "textField" of window "main" to "foo"

But it happens to be inside a box, so it really should be:

Applescript:

set contents of text field "textField" of box "someBox" of window "main" to "foo"

You may want to add some breakpoints and run your apps through the debugger if they're particularly complex. That will help you find where it's happening.

Question: Does this happen on apps you didn't make? I.e., are you having probems running apps that should work normally that you got from somewhere on the Internet?If so, can you give us some examples and URLs?

Last edited by Mikey-San (2006-04-24 07:26:46 am)

Offline

 

#3 2006-04-24 07:43:53 am

iPenguin
Member
Registered: 2006-04-24
Posts: 6

Re: NSReceiverEvaluationScriptError: 4 (1) ?

Yeah, this is happening in apps I didn't make.

Examples are:
Pause: http://macupdate.com/info.php/id/17461
It takes a couple seconds for the NSEvaluation error to pop up but eventually it does and then periodically it will pop up again. It also appears when I click the "More Options" button.

MoaTunes: http://www.macupdate.com/info.php/id/8533

The dialog pops up right away, and then again after I press the Ok button. The main window never appears.

Xupport: http://www.macupdate.com/info.php/id/9256

Same as Moatunes.

iWake: http://www.macupdate.com/info.php/id/18620

Two dialogs pop up right away, then a third. One also appears when I close the main window, and when I quit.

Like I said I used to be able to use all these apps without a hitch. I'm not quite sure when this problem started since I don't really use any of these apps all that frequently. I think the first app I noticed in was MoaTunes, but at the time I just passed it off as MoaTunes being weird, because it had a tendency to do odd things... Then today, another app popped up that message, and I thought "Hey... I've seen that before..." and decided to check all my other applescript programs.

Thanks again.

Offline

 

#4 2006-04-24 09:39:01 am

Mikey-San
Member
Registered: 2005-07-13
Posts: 509

Re: NSReceiverEvaluationScriptError: 4 (1) ?

Weird. A few questions:

1. What version of Mac OS X are you running?

2. Does this happen with clean (new) test user accounts?

3. (This is going to sound stupid, but . . .) Have you restarted since this problem began?

Offline

 

#5 2006-04-24 10:08:24 am

iPenguin
Member
Registered: 2006-04-24
Posts: 6

Re: NSReceiverEvaluationScriptError: 4 (1) ?

I'm running 10.4.6. And yeah, restarting was the first thing I tried...

The apps do run fine in a test account though, so it must be something I did to my account... Hopefully, I can narrow down what's causing the problem.

Thanks again for the help.

Edit: Okay, I found out what was causing the problem. It was a SIMBL plugin for making windows fullscreen (megazoomer: http://macupdate.com/info.php/id/21275) and it looks like other people were having the same problem.  Phew! I'm glad that problem's over!

Last edited by iPenguin (2006-04-24 10:16:53 am)

Offline

 

#6 2006-05-01 01:09:40 am

swmj
Member
Registered: 2006-04-30
Posts: 1

Re: NSReceiverEvaluationScriptError: 4 (1) ?

Well, I found this thread by copying the error message and doing a Google search on it.

When I run the "Save Safari Web Archive" script which I found on this message board, this message does NOT come up.  But when I add the statement

repeat while (window 1 of application "Safari" is not null)

at the beginning and also add the statement

end repeat

after the script (but before the final "to" loop), the script saves multiple open windows instead of just one, which is the purpose in making this change, but then the error message pops up.

I noticed that the error also pops up if I attempt to run the script (either the original or my modified version) without any window open in Safari.

Model: PowerBook G5 1.5 GHz
AppleScript: 1.10.6
Browser: Safari 417.9.2
Operating System: Mac OS X (10.4)

Offline

 

#7 2011-05-02 11:15:45 pm

AS_Mac_Script
Member
Registered: 2006-04-18
Posts: 10

Re: NSReceiverEvaluationScriptError: 4 (1) ?

We are trying to use the below code but it gives error "NSReceiverEvaluationScriptError: 4 (1)"

Applescript:

tell application "Adobe Acrobat Pro"



activate



open PdfFile



end tell



tell application "System Events"



tell application process "Acrobat"



click the menu item "PostScript" of menu 1 of menu item "PostScript" of menu 1 of menu item "Export" of the menu "File" of menu bar 1



keystroke "/"



keystroke keyString & onlyFileName



keystroke "



"




keystroke "


"



end tell


end tell

It give a problem on click the menu item. This code is working fine on my own laptop but it doesn't work on user system. All the configuration of OS and application version are identical.

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)