I’m not sure what I’m doing wrong. I’ve got a preferences window with tabbed views for collecting preferences for an application. I can’t seem to get one of the text fields to update after using an open panel. (My code is based in the Archive Maker application that comes under the example apps. The only difference is that I’m working with a window not a drawer of a window.) Any ideas would be appreciated.
on panel ended theObject with result withResult
global irisLocation
-- The Preferences window IRIS location choose button was clicked and a directory location was chosen.
if theObject is the open panel then
if withResult is 1 then
set irisLocation to item 1 of (path names of open panel as list) as text
set contents of text field "irisLocationField" of tab view item "irisTabFields" of tab view "prefWindowTabs" of window "prefWindow" to irisLocation as text
end if
end if
end panel ended
And for those that want to see the window that prompts for the directory location:
--Prompts the user to select the location where the IRIS application lives that should have the data imported.
on chooseIrisLocation()
--Setup the open panel properties
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 "prefWindow"
end chooseIrisLocation
Thanks in advance,
Jack