Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSReceiverEvaluationScriptError: 4 (1)==>show window command



Thank you very much JJ.

It works. (ofcourse)

Thanks again by the way :-)

Greetings Bastiaan

Op 12-jan-2006, om 12:42 heeft jj het volgende geschreven:

Hi list

With applications I've written in xcode 1.5 and panther I used the
next handler

on activate theObject
show window "main"
end activate

This results in almost the same as every Mac OS 10.3.x application.
When you closed window "main" then you de-activate and activate your
programm you will see the main window of the application again. Now
in Tiger I get this returned when the show window command is triggered


NSReceiverEvaluationScriptError: 4 (1)

Does Anyone know how to show an window for the second time after it
was closed? Showing the first time works but fails on the second attemp.

Yes, this is a bug. When you close the window, it suffers a name loss (as in
The Spiriting Away of Sen and Chihiro). That's why the next time you can't
show window "main" (as there isn't such a called window).


The workaround, IIRC, is attaching a "will close" event to the window, then:

on will close theObject
    set visible of theObject to false
    return false
end will close

To show it:

set visible of window "blah" to true


jj

--
http://www.macscripter.net/
http://www.osaxen.com/


_______________________________________________ Do not post admin requests to the list. They will be ignored. Applescript-studio mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/applescript-studio/email@hidden

This email sent to email@hidden
References: 
 >Re: NSReceiverEvaluationScriptError: 4 (1)==>show window command (From: jj <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.