Hello I can’t find out what is going on i have every thing setup right. I have two tab views and a table view in it here us the code.
set picturetable to data source of table view "pictures" of scroll view "pictures" of view of tab view item "p" of tab view "e" of view of tab view item "e" of tab view "view" of window "main"
tell picturetable
make new data column at the end of the data columns with properties {name:"Picture ID"}
end tell
here is the error The variable picturetable is not defined. (-2753)
I don’t know what else to do.
Browser: Safari 523.10.6
Operating System: Mac OS X (10.5)
Sounds like you’ve not created the datasource yet. Tables don’t automatically come with datasources - you either need to hook one up in Interface Builder (which is often a bit difficult and a little flakey) or create one in applescript:
set picturetable to make new data source at end of data sources with properties {name:"names", [i](some other properties for each column)[/i]}
set theObject to table view "pictures" of scroll view "pictures" of view of tab view item "p" of tab view "e" of view of tab view item "e" of tab view "view" of window "main"
set data source of theObject to picturetable
Ok that worked but now I’m getting this message
and here is my code to set it.
set theRow to make new data row at the end of the data rows of table view "pictures" of scroll view "pictures" of view of tab view item "p" of tab view "e" of view of tab view item "e" of tab view "view" of window "main"
set contents of data cell "Picture ID" of theRow to "Test"
You left out the datasource reference in your code. Try this:
set theRow to make new data row at the end of the data rows of datasource picturetable of table view "pictures" of scroll view "pictures" of view of tab view item "p" of tab view "e" of view of tab view item "e" of tab view "view" of window "main"
set contents of data cell "Picture ID" of theRow to "Test"