I am having a problem getting my table view data source to work. I am interested in a fix but a reason why would be useful as well. I am new to applescript studio… and if you see something in my code that is stupid that would be halpful too. … and thanks in advance.
on awake from nib theObject
set loginPanel to window "Login"
display loginPanel attached to window "Main"
--end if
--############ set variables
set shortname to do shell script "whoami"
tell application "Finder"
set startupDiskName to (name of startup disk)
end tell
--########### make some aliases
set theFile to (startupDiskName & ":Users:" & shortname & ":Library:Preferences:SpellingTeacherPrefs:users.txt") as alias
--########### get user file data
open for access theFile
set theData to read theFile using delimiter return
close access theFile
set makeRows to {}
set text item delimiters to tab
repeat with i from 1 to count of theData
set theLine to text items of item i of theData
copy theLine to the end of makeRows
end repeat
set text item delimiters to ""
--return makeRows
set theColumns to ""
repeat with i from 1 to count of makeRows
set theColumns to theColumns & " " & item 1 of item i of makeRows & return
end repeat
--return theColumns
-- problem code below[color=red]
set cell_values to theColumns
tell theObject
set theDataSource to data source of table view "users" of scroll view "users"
tell theDataSource
make new data column at the end of data columns with properties {name:"student"}
repeat with cell_value in cell_values
set theRow to make new data row at the end of data rows
set contents of data cell "student" of theRow to ((contents of cell_value) as string)
end repeat
end tell
end tell[/color]
end awake from nib