FMP 11 reports error: object or property in the wrong data type when copying an image into a cell
FMP 11 Advanced
Operating system version
OS X 10.7
Description of the issue
I'm attempting to set a FMP container cell with image data from iTunes within an AppleScript. This used to work under v9 and OS X 10.6. This is the first I have tried the script since upgrading both FMP (from 9 to 11) and OS X (from 10.6 to 10.7). Now I receive the error FMP Advance got an error: Object or property is the wrong type.
There are earlier posts of a similar but different problem from v 9 to 10 that seem to be resolved by the method of referencing an image file.
I am unable to make the mental transition from a file reference (as the other problems) to the movement of the actual data - which is what I am doing. In other words, the image I am attempting to capture is not a stand alone file, rather the imbedded artwork from iTunes.
Thanks to the always helpful FM user community and support staff.
Steps to reproduce the problem
here is the script code snippets:
set tCoverArt to "" -- when no cover art present - script gets data error
try -- this allows a null cover art
set tCoverArt to (data of artwork 1) -- iTunes artwork container
if tCoverArt is not "" then
set cell "VA_Album Cover" of current record to tCoverArt
Previously, the data was updated in the FMP database and viewable as an image on the layouts that use that container field.
(VA_Album Cover is defined as a container field). Note that code above this sets other fields of the database from iTunes data successfully so I am confident of the correct iTunes track record and the correct FMP record.
I also know that in this instance the image format is PNG (not all of the iTunes artwork is PNG - but this is the first record of any type since the upgrades.)
Exact text of any error message(s) that appear
FMP Advanced got an error: Object or property is the wrong type.