getting the current selected item in a browser cell

I have a Presets Drawer on one of my windows where the idea is a user should be able to save the windows current configuration as a preset so at a later date the user can select of of his presets and restore that windows configuration to that previously saved state. The drawer consists of three buttons. A “+” button for saving a preset, a “-” button for deleting a preset and a “Load” button to load the currently selected preset. So far I’ve got it saving the preset just fine and the presets show up in the browser view. Where I’m having trouble is getting the currently selected row which is needed to make both the “-” button and the “Load” button work.

What I’ve tried is…

set theFile to content of current row of browser "Presets Browser" of drawer "Presets Drawer" of window "MyWindowName"

and several variations of that theme like…

set theFile to string value of selected row of browser cell 1 of browser "Presets Browser" of drawer "Presets Drawer" of window "MyWindowName"

and others but so far everything throws the same error dialog “Can’t get <> of <> “Presets Browser” of <> “Presets Drawer” of window “MyWindowName”. (-1728)” or some variation of that depending on what element hierarchy I used but always “Can’t get…”

The best list of error codes I’ve found so far is this one…,
http://www.appleerrorcodes.com/

and they have nothing in that range.

the example script “Bowser” that comes with xCode shows how to display a browser and get data in it but doesn’t go into how to handle a users selection.

Any one have any ideas?

Yup that did the trick. Thanks. :smiley: