Hello,
I’m writing a quick application and as part of that would like to display some help info as a sheet. I’ve looked at the Apple documentation and also code snippets from this site and others but I can’t make it work.
I tried making a prototype app to keep things simple and it corrently contains the following code:
on clicked theObject
if the name of theObject is “button” then
load nib “Untitled”
set mywindow to window “window2”
display window mywindow attached to “window1”
end if
end clicked
At the moment I have one window in the MainMenu.nib and the other window in Untitled.nib. The windows are named window1 and window2 in the applescript pane of Inspector…
However when I run this I get the error:
Can’t make window (window id 3) into type reference. (-1700)
has anyone solved it? I have a nib: “EndiciaDetail” containing NSWindow “EndiciaDetailWindow” attached to my project.
Someone clicks a button on “MainWindow” and it should open this window
I have the following:
log "Loading NIB for EndiciaDetail"
load nib "EndiciaDetail"
log "Setting view"
set theEndiciaTableView to table view "listingtable" of scroll view "listingview" of window "EndiciaDetailWindow"
log "Setting content of theEndiciaTableView"
set content of theEndiciaTableView to EndiciaDetailsList
log "Displaying Window"
display panel window "EndiciaDetailWindow" --dies here w/same error "NSReceiversCantHandleCommandScriptError (4)"