Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Table and Applescript Studio



Johan

Leave getting the list of files for now, just set the list (klassTextfiler?) to something simple, like {{"A", "1"}, {"B", "2"}}. See if you can populate the table with that.

If you still can't populate the table, you then know that your 'Studio' code is wrong. If you can populate the row, then you can move on to getting the list of files and populating the table with that.

Instead of using a repeat loop to populate the table, try the 'append' command. See the Terminology Reference.

By the way, for debugging, I prefer to use log instead of display dialog, because log shows the exact form of a variable, whereas display dialog converts it to a string. For example, display dialog {{2}} will display "2", not revealing that it is actually a double list containing an integer.

MarkB


On Monday, Aug 11, 2003, at 15:07 US/Pacific, Johan Friberg wrote:

On 03-08-11 16.39, "Mark Butcher" <email@hidden> wrote:

I'd first get the table working, and populate it with a simple list of
strings {{"A", "1"}, {"B", "2"}}.

Thought I would go ahead and make a try while waiting for the book but got
this far but still can't populate the table:

on clicked theObject
(*Add your script here.*)
end clicked

on will open theObject

tell application "Finder"
set PathtoKlassfil to (folder "Foto:text" of desktop) as string

set klassTextfiler to (every file of the folder PathtoKlassfil) as
string
display dialog test as string
end tell

set datasource to data source of table view "filtable" of scroll view
"scroller" of window "tablewin"
--set update views of datasource to false
tell datasource
--delete data columns
make new data column at the end of the data columns ,
with properties {name:"Antal"}
make new data column at the end of the data columns ,
with properties {name:"Filnamn"}
--delete data rows
end tell

repeat with n from 1 to (count files of klassTextfiler)

set theRow to make new data row at the end of ,
the data rows of datasource

--set contents of data cell "Antal" of theRow to ,
-- item 1 of item n of test
set contents of data cell "Filnamn" of theRow to ,
item n of klassTextfiler
--tell table view "filtable" of scroll view "scroller" to update

end repeat
--set update views of datasource to true

end will open


/Johan
_______________________________________________
applescript-studio mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-studio
Do not post admin requests to the list. They will be ignored.
_______________________________________________
applescript-studio mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-studio
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Table and Applescript Studio (From: Johan Friberg <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.