Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Applescript > select table ro...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 8 Topic 1492 of 1674
Post > Topic >>

select table row

by Joshua Whalen <joshuafwhalen@[EMAIL PROTECTED] > Aug 13, 2007 at 07:40 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 MyRow
      set MyDataSnippet2 to contents of data cell 2 MyRow
      set MyDataSnippet3 to contents of data cell 3 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
 




 8 Posts in Topic:
select table row
Joshua Whalen <joshuaf  2007-08-13 19:40:05 
Private Message
   2007-08-13 17:15:26 
Private Message
   2007-08-13 20:58:42 
Private Message
   2007-08-13 18:08:57 
Private Message
   2007-08-13 19:37:07 
Private Message
   2007-08-13 22:01:36 
Private Message
   2007-08-13 21:04:41 
Private Message
   2007-08-15 09:59:28 

Post A Reply:
  Go here to Signup

AddThis Feed Button


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

Contact
tan12V112 Fri Nov 21 8:59:50 CST 2008.