Unable to populate Data Source with Array with image references

Hi,

i discovered that seems impossible to populate a data Source with append command if my array contains images references.
Table column is correctly set with image cell.

Example:
property arrayElements: null

set imagePath to “pdfErrore” – (with or without extension)
set testImage to load image imagePath
set myArray to {imageIcon:testImage, fullName:“Steve Jobs”}

tell pDataSource
set update views to false
append with arrayElements
set update views to true
end tell

This should be the fastest way to populate a data source if my array is composed by hundreds or thousands of records.

If we use another approach:

tell pDataSource
set update views to false
repeat with j from 1 to count my arrayElements
set newRow to make new data row at end of data rows
tell newRow
set contents of data cell 1 to testImage
end tell
end repeat
set update views to true
end tell

This is very very slow if you have 5000/1000 records.

PS: if you get content of data source after method 2 you get exactly the initial array of method 1. Seems that “append” command don’t work.

Any suggestions?

Alex

Hi,

Second post with correct syntax

i discovered that seems impossible to populate a data Source with append command if my array contains images references.
Table column is correctly set with image cell.

Example:
property arrayElements: null

set imagePath to “pdfErrore” – (with or without extension)
set testImage to load image imagePath
set arrayElements to {imageIcon:testImage, fullName:“Steve Jobs”}

tell pDataSource
set update views to false
append with arrayElements
set update views to true
end tell

This should be the fastest way to populate a data source if my array is composed by hundreds or thousands of records.
But each time I get error message in console

If we use another approach:

tell pDataSource
set update views to false
set numRecords to count my arrayElements
repeat with j from 1 to numRecords
set newRow to make new data row at end of data rows
tell newRow
set contents of data cell 1 to testImage
end tell
end repeat
set update views to true
end tell

This is very very very slow if you have 5000/10000 records.

PS: if you get content of data source after method 2 you get exactly the initial array of method 1. Seems that “append” command don’t work.

Any suggestions?

Alex