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: Need help with applescript studio table



Are you working in OS 10.4? Because 'window of theObject' does not work on my computer. So I named the window "main"
The other problem was that you define myData after you would like to fill in the table view.
myData will not go automaticly to the getContactInfo handler. I send myData as an argument to the handler but you can also make a property of myData just like contactsDataSource.
Also data source of table view "contacts" of scroll view "contacts" of window "main" is not there when you never made one. Well my OS is 10.3.9 and it returns a missing value. In the on will open handler I make a new data source.

well here's my solution

property contactsDataSource : missing value

on clicked theObject --button "Populate"
set theRow to make new data row at the end of the data rows of contactsDataSource
display dialog class of theRow
set myData to {{"item1", "item2", "item3", "item4", "item5", "item6", "item7"}, {"empty"}}
window "main", theRow, myData)
end clicked

on will open theObject
set contactsDataSource to make new data source at end of data sources with properties {name:"contacts"}
tell contactsDataSource
make new data column at the end of the data columns with properties {name:"Name"}
make new data column at the end of the data columns with properties {name:"Page"}
make new data column at the end of the data columns with properties {name:"Bounds"}
make new data column at the end of the data columns with properties {name:"Scale"}
make new data column at the end of the data columns with properties {name:"Horizontal Scale"}
make new data column at the end of the data columns with properties {name:"Vertical Scale"}
make new data column at the end of the data columns with properties {name:"File Path"}
end tell
set data source of table view "contacts" of scroll view "contacts" of window "main" to contactsDataSource
end will open

on theWindow, theRow, myData)
tell theWindow
set contents of data cell "Name" of theRow to item 2 of item 1 of myData
set contents of data cell "Page" of theRow to item 3 of item 1 of myData
set contents of data cell "Bounds" of theRow to item 7 of item 1 of myData
set contents of data cell "Scale" of theRow to item 6 of item 1 of myData
set contents of data cell "Horizontal Scale" of theRow to item 4 of item 1 of myData
set contents of data cell "Vertical Scale" of theRow to item 5 of item 1 of myData
set contents of data cell "File Path" of theRow to item 1 of item 1 of myData
end tell
end getContactInfo

Op 6-jul-05 om 16:52 heeft Pete Kincaid het volgende geschreven:

Hello, Im trying to import information into my table object. This is my
script. I know the names of the tableView, ScrollView are correct. But I
keep getting an error when ever I hit my populate button

property contactsDataSource : null
on clicked theObject --button "Populate"
set theRow to make new data row at the end of the data rows of
contactsDataSource
display dialog class of theRow
getContactInfo(window of theObject, theRow)
set myData to {{"item1", "item2", "item3", "item4", "item5", "item6",
"item7"}, {"empty"}}
end clicked
on will open theObject
set contactsDataSource to data source of table view "contacts" of scroll
view "contacts" of window of theObject
tell contactsDataSource
make new data column at the end of the data columns with properties
{name:"Name"}
make new data column at the end of the data columns with properties
{name:"Page"}
make new data column at the end of the data columns with properties
{name:"Bounds"}
make new data column at the end of the data columns with properties
{name:"Scale"}
make new data column at the end of the data columns with properties
{name:"Horizontal Scale"}
make new data column at the end of the data columns with properties
{name:"Vertical Scale"}
make new data column at the end of the data columns with properties
{name:"File Path"}
end tell
end will open
on getContactInfo(theWindow, theRow)
tell theWindow
set contents of data cell "Name" of theRow to item 2 of item 1 of
myData
set contents of data cell "Page" of theRow to item 3 of item 1 of
myData
set contents of data cell "Bounds" of theRow to item 7 of item 1 of
myData
set contents of data cell "Scale" of theRow to item 6 of item 1 of
myData
set contents of data cell "Horizontal Scale" of theRow to item 4 of
item 1 of myData
set contents of data cell "Vertical Scale" of theRow to item 5 of
item 1 of myData
set contents of data cell "File Path" of theRow to item 1 of item 1
of myData
end tell
end getContactInfo
--
Peter Kincaid
Data Conversion
Schawk, Inc.
(815)444-2338

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-studio mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-studio/email@hidden

This email sent to email@hidden
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-studio mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-studio/email@hidden

This email sent to email@hidden

References: 
 >Need help with applescript studio table (From: Pete Kincaid <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.