on clicked theObject
if (name of theObject is "chooseFile") then
chooseDefaultLocation()
else if (name of theObject is "actionButton") then
set theFolder to POSIX file folderChosen as text
-- ...
end clicked
on panel ended theObject with result withResult
if withResult is 1 then
set folderChosen to path name of open panel
set contents of text field "path name" of tab view item 1 of tab view 1 of window "main" to folderChosen
else
set contents of text field "path name" of tab view item 1 of tab view 1 of window "main" to ""
end if
end panel ended
on chooseDefaultLocation()
-- Setup the open panel properties
tell open panel
set can choose directories to true
set can choose files to false
end tell
display open panel attached to window "main"
end chooseDefaultLocation
Isnt the problem in the on chooseDefaultLocation() handler ?