How would I go about making a list using 1 column (First column specifically) so that each row is a separate item in the list?
Here’s what I have so far, but it doesn’t work. Tables are confusing!:rolleyes:
set tableView to table view "contacts" of scroll view "contacts" of window of theObject
set theDataSource to data source of tableView
set theRowCount to the count of every data row of theDataSource
set x to 1
repeat until x is theRowCount
set the_data to the content of data row x of theDataSource
set theList to theList & the_data
set x to x + 1
end repeat
display dialog theList
I think you should use choose from list instead of display dialog
I don’t need the display dialog for the program at all, only using it for testing purposes only; only to see if I actually created the list.
Well, it’s actually a lot easier than you think it is:
set a to content of table view 1 of scroll view 1 of window 1
set res to {}
repeat with i from 1 to count a
set end of res to item 1 of item i of a
end repeat
return res
Also, if you’re not going to be using any variables in a test, I find that opening your application and the normal Script Editor at the same time and telling your app to get things is a lot easier. For example, to find out how to do this, I opened up the “Table” example in the Developer folder and then wrote tiny scripts like this one:
tell application "Table" to get content of table view 1 of scroll view 1 of window 1
-->{{|name|:"bob", zip:"zoom", state:"gif", address:"phil", city:"zap"}, {|name|:"foo", zip:"gum", state:"baz", address:"bar", city:"bat"}}
Of course, you’d have to enter stuff into the table first.