Talk About Network

Google




Programming > Applescript > select table ro...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 5 Topic 1493 of 1697
Post > Topic >>

select table row

by Joshua Whalen <joshuafwhalen@[EMAIL PROTECTED] > Aug 13, 2007 at 09:07 PM

I need to loop through the contents of a multi-column table view, get 
the contents as a list of records (or any other way, honestly. I'm an 
American, after all, coercion is our specialty, these days), and the 
following is my current, unsuccessful attempt.


on SaveTheData()
   set MyTable to (data source of table view 1 of scroll view 1 of 
window 1)
   set the_count to (count data rows of MyTable)
   repeat with i from 1 to the_count
      set myRow to data row i of MyTable
      set selected data row of MyTable to myRow
      set MyDataSnippet1 to contents of data cell 1 of MyRow
      set MyDataSnippet2 to contents of data cell 2 of MyRow
      set MyDataSnippet3 to contents of data cell 3 of MyRow
      set MyOutListItem to {item1:MyDataSnippet1, item2:MyDataSnippet2, 
item3:MyDataSnippet3}
      set this_data to ((MyOutListItem) as text) & return
      set this_file to (((path to desktop folder) as text) & 
"dataTextTest.txt")
         my write_to_file2(this_data, this_file, true)
   end repeat
   
end SaveTheData


there'll be more for it to do once  I get it to do anything but return 
an error message. What I want to do is append each row's contents to a
text file. 

To the best of my ability to determine, the problem is setting the 
selected row. Applescript says:

Can't make «class seDR» of «class datS» id 15 into type reference. 
(-1700)

Any clues?
TIA!

Joshua
 




 5 Posts in Topic:
select table row
Joshua Whalen <joshuaf  2007-08-13 21:07:56 
Re: select table row
Jason Davies <davies_j  2007-08-13 20:53:41 
Re: select table row
Joshua Whalen <joshuaf  2007-08-13 23:24:31 
Re: select table row
Tony Walton <tonywalto  2007-08-15 10:00:43 
Re: select table row
Joshua Whalen <joshuaf  2007-08-20 17:13:54 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
localhost-V2008-12-19 Tue Jan 6 1:05:49 PST 2009.