So I have this open panel that is created like this:
on chooseDefaultLocation()
log "chooseDefaultLocation"
set gettingFolder to true
tell open panel
set can choose directories to true
set can choose files to false
set prompt to "Choose"
end tell
display open panel attached to window "prefsWindow"
end chooseDefaultLocation
This panel is for choosing a default folder that contains files used in the rest of the solution. This works and when it ends the panel ended handler is called and life is good.
I now need another open panel that will look for files not folders when this is finished it needs to load a different variable than the previous one.
I call it in a similar manner:
on chooseFile()
log "ChooseFile"
set gettingFile to true
tell open panel
set can choose directories to false
set can choose files to true
set prompt to "Choose"
activate
end tell
display open panel
end chooseFile
As you can see the first is attached to one of my windows and the second is free floating.
The first problem is, when this panel ends, the panel ended handler is not called.
The next part is that I am using another variable to branch the panel ended handler (this is the geetingFolder and gettingFile booleans. Is there a more elegant way for me to determine which panel has ended?
Dee