I have 1 window with 2 tables on it. These tables are identical exept for the name of the view table and the scrollview name
I have 2 buttons
Each one of these buttons has the same exact script as the other, exept for the targets are different, 1 is addressing the “data” table, the other script is addressing the “public” table.
For some reason, only one of the tables is working. Is there a problem with having 2 tables on 1 window. Is there a setting for the tables that cannot be the same as the other table?
Thanks
Ill try and give more info in hopes of a replay
I am getting this error “NSContainerSpecifierError (2)”
I have 2 identical tables on the same window
Table 1 is scrollview “DataBox” TableView “Data”
Table 2 is scrollview “dbbox” TableView “db”
These are my 2 scripts. Almost Identical, the only difference is the table. When I click the “populate button” it works, but if I click the “ds” button it fails
Im I a idiot, I just cant fiqure this out
Script 1
property theDataSource2 : null
global myData, thefile
on clicked theObject
if name of theObject is equal to "ds" then
set thefile to alias "Mac5220 OSX:Users:petekincaid:Desktop:no window test:Data"
set theDataSource2 to data source of table view "db" of scroll view "dbbox" of window of theObject
tell theDataSource2
make new data column at the end of the data columns with properties {name:"Image 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:"Type"}
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:"H Scale %"}
make new data column at the end of the data columns with properties {name:"V Scale %"}
make new data column at the end of the data columns with properties {name:"File Path"}
end tell
getContactInfo(window of theObject)
else
if name of theObject is equal to "Clear" then
my clearData()
end if
end if
end clicked
on getContactInfo(theWindow)
try
open for access thefile
set fileContents to (read thefile using delimiter return)
close access thefile
on error
close access thefile
end try
repeat with arow in fileContents
set theItem to make new data row at end of every data row of theDataSource2
set AppleScript's text item delimiters to tab
set arow to text items of arow
tell theWindow
set contents of data cell "Image Name" of theItem to item 2 of arow
set contents of data cell "Page" of theItem to item 3 of arow
set contents of data cell "Type" of theItem to item 7 of arow
set contents of data cell "Scale" of theItem to item 6 of arow
set contents of data cell "H Scale %" of theItem to item 4 of arow
set contents of data cell "V Scale %" of theItem to item 5 of arow
set contents of data cell "File Path" of theItem to item 1 of arow
if contents of data cell "File Path" of theItem is "" then
set contents of data cell "File Path" of theItem to "Embedded Image"
end if
end tell
end repeat
set AppleScript's text item delimiters to ""
end getContactInfo
Here is the 2nd script
property theDataSource : null
global myData, thefile
on clicked theObject
if name of theObject is equal to "Populate" then
set thefile to alias "Mac5220 OSX:Users:petekincaid:Desktop:no window test:Data"
set theDataSource to data source of table view "Data" of scroll view "DataBox" of window of theObject
tell theDataSource
make new data column at the end of the data columns with properties {name:"Image 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:"Type"}
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:"H Scale %"}
make new data column at the end of the data columns with properties {name:"V Scale %"}
make new data column at the end of the data columns with properties {name:"File Path"}
end tell
getContactInfo(window of theObject)
else
if name of theObject is equal to "Clear" then
my clearData()
end if
end if
end clicked
on getContactInfo(theWindow)
try
open for access thefile
set fileContents to (read thefile using delimiter return)
close access thefile
on error
close access thefile
end try
repeat with arow in fileContents
set theItem to make new data row at end of every data row of theDataSource
set AppleScript's text item delimiters to tab
set arow to text items of arow
tell theWindow
set contents of data cell "Image Name" of theItem to item 2 of arow
set contents of data cell "Page" of theItem to item 3 of arow
set contents of data cell "Type" of theItem to item 7 of arow
set contents of data cell "Scale" of theItem to item 6 of arow
set contents of data cell "H Scale %" of theItem to item 4 of arow
set contents of data cell "V Scale %" of theItem to item 5 of arow
set contents of data cell "File Path" of theItem to item 1 of arow
if contents of data cell "File Path" of theItem is "" then
set contents of data cell "File Path" of theItem to "Embedded Image"
end if
end tell
end repeat
set AppleScript's text item delimiters to ""
Model: Mac G4
Browser: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.5) Gecko/20041217
Operating System: Mac OS X (10.3.8)