Oh the code works fine! It compiles no problem !
Well first, to be more precise, the window is the main window.
The panel doesn’t show on launch, I only want it to appear when a button is clicked. The panel only shows a list of selected files from the main window.
But I would like to be able to them both open at the same time, which doesnt work at the moment.
By “unaccessible” I mean that as long as the panel is open, I cannot use the window (it stays in the back) and when I click on the window I hear an error sound. Does that make sense?
Here is the code I have, nothing special :
on clicked theObject
if (name of theObject is "openPanel") then
display panel window "fileListPanel"
else if (name of theObject is "closePanel") then
close panel window 1
end if
End clicked
The closePanel button is on the panel itself because if I close it by clicking the red close button (on the bar) then it disappears, but I cant use the main window !
I see the problem. You are showing and hiding the panel wrong. When you use “display” it is like you are displaying a dialog box and thus the application pauses and waits for the dialog to be dismissed. It’s just like display dialog in applescript.
To show a window/panel use the word “show”… that makes it visible
show panel "fileListPanel"
To hide a panel or a window use this…
set visible of panel "fileListPanel" to false
Note: Panels can be strange some times meaning that sometimes you have to call them a window instead of a panel. So use “panel” first and if that doesn’t work then try “window”.