Hi,
I’m trying to populate a table with a list of local disks in one column and a checkbox in the other. Everything works OK, except that instead of multiple rows in the table, I get this:
Column one Column two (checkbox)
(DiskOne, “Disk_Two”) [ ]
Here’s how I’m doing it now:
on getdisklist()
--set thedisklist to {}
set thedisklist to (do shell script "/usr/sbin/diskutil list |/usr/bin/grep Apple_HFS|/usr/bin/awk '{print $3}'")
display dialog thedisklist -- results in a return-delimited list of mounted disks
set thedisklistoutput to every paragraph of the thedisklist as list
end getdisklist
on will open theObject
if the name of theObject is "disklister" then
getdisklist()
display dialog thedisklist -- results in a return-delimited list of mounted disks
set disklistdatasource to make new data source at end of data sources with properties {name:"Disklist"}
make new data column at the end of the data columns of disklistdatasource with properties {name:"Disk"}
make new data column at the end of the data columns of disklistdatasource with properties {name:"Watched"}
set sorted of disklistdatasource to true
-- Set the "name" data column as the sort column
set sort column of disklistdatasource to data column "Disk" of disklistdatasource
set data source of table view "disklisttable" of scroll view "disklistscroll" of window "disklister" to disklistdatasource
append disklistdatasource with {{thedisklistoutput}}
end if
end will open
What’s the trick to turning this return-delimited list into multiple rows?