Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 4867 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

This worked before >10.6 now it doesn't or it works sporatically.

I have a script that grabs the metadata from a track in iTunes (including artwork) then creates a record in FM and sets specific field. It all works except for the container field I'm trying to set with the artwork.

I get this error "error "FileMaker Pro Advanced got an error: Object or property is the wrong type." number -10001 to item"

With the code to set the container field omitted, the script works great. Any help would be greatly appreciated. Here's my script that is run within FileMaker so the on MakerRecord does not have a tell application "FileMaker Pro" step.

property FM_NAME : ""

property FM_ARTIST : ""

property FM_COMPOSER : ""

property FM_ALBUM : ""

property FM_GENRE : ""

property FM_LOCATION : ""

property FM_TIME : ""

property FM_TRACKTOTAL : ""

property FM_PLAYLIST : ""

property FM_LABEL:""

property FM_CATALOG:""

property FM_CATEGORY:""

property FM_NOTES:""

property FM_YEAR:""

property FM_LYRICS:""

property FM_BPM:""

property FM_ARTWORK:""

property newData:{}

activate

tell application "iTunes"

set thePlaylist to front window's view

set FM_TRACKTOTAL to count tracks of thePlaylist

set FM_PLAYLIST to name of thePlaylist

repeat with i from 1 to FM_TRACKTOTAL

set FM_NAME to name of track i of thePlaylist

set FM_ARTIST to artist of track i of thePlaylist

set FM_COMPOSER to composer of track i of thePlaylist

set FM_ALBUM to album of track i of thePlaylist

set FM_GENRE to genre of track i of thePlaylist

set FM_TIME to time of track i of thePlaylist

set FM_YEAR to year of track i of thePlaylist

set FM_NOTES to comment of track i of thePlaylist

set FM_LOCATION to location of track i of thePlaylist as string

set FM_LYRICS to lyrics of track i of thePlaylist

set FM_BPM to bpm of track i of thePlaylist

try

set FM_ARTWORK to data of artwork 1 of track i of thePlaylist

end try

set newData to {FM_NAME , FM_ARTIST , FM_CATALOG , FM_TIME , FM_ALBUM, FM_LABEL , FM_YEAR , FM_COMPOSER , FM_GENRE , FM_LOCATION, FM_NOTES , FM_LYRICS , FM_BPM , FM_ARTWORK}

my MakeRecord(newData)

end repeat

if (exists of playlist "PTB Temp") then

delete playlist "PTB Temp"

end if

end tell

on MakeRecord(theData)

create new record in layout "Import" in window "Publisher's Toolbox Creative System" with data theData

end MakeRecord

This topic is 4867 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.