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

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

Recommended Posts

  • Newbies
Posted

Here is the Applescript code run from within FileMaker that copies the CD info from iTunes and inserts it into FileMaker. However it no longer works with FileMaker 7 or 8. It only copies the first track and inserts that track and that is all. The layout used to insert the tracks is a layout with a Self Join relationship showing only the portal.

I did not write the original AppleScript, I'm "almost" totally lost. But understand enough to fix this if I had the right direction. Can anyone tell me what needs to be done?

on run

clearProperties()

tell application "iTunes"

set thePlaylist to front window's view

copy every track of thePlaylist to allTracks

set trackCt to count of allTracks

repeat with i from 1 to count of allTracks

copy item i of allTracks to thisTrack

set currArtist to (thisTrack's artist as string)

set currGenre to (thisTrack's genre as string)

if i = 1 then

copy (thisTrack's album as string) to diskName

copy (thisTrack's artist as string) to diskArtist

copy (thisTrack's genre as string) to diskGenre

else

if currArtist is not diskArtist then

set diskArtist to "Various Artists"

end if

if currGenre is not diskGenre then

set diskGenre to "misc"

end if

end if

copy (thisTrack's name as string) to end of allNames

copy (thisTrack's artist as string) to end of allArtists

copy (thisTrack's year as string) to end of allYears

copy (thisTrack's genre as string) to end of allGenres

copy (thisTrack's album as string) to end of allAlbums

set currTime to (thisTrack's time as string)

set currTime to ("0:" & currTime as string)

copy currTime to end of allTimes

set trackNum to (thisTrack's track number as string)

if trackNum = "0" then

set allTnums to 0

end if

if allTnums is not 0 then

copy (thisTrack's track number as string) to end of allTnums

end if

copy i to end of trackCounter

end repeat

end tell

enterData()

clearProperties()

end run

on enterData()

tell application "FileMaker Pro"

activate

go to layout "iTunes Importer"

try

set newRec to create new record

show newRec

activate

with timeout of 5000 seconds

try

set cell "CD Importer SELF JOIN::TPDiscNumber_Name" of newRec to allAlbums

set cell "CD Importer SELF JOIN::TrackTitle" of newRec to allNames

set cell "CD Importer SELF JOIN::ArtistLastNameGroupName" of newRec to allArtists

set cell "CD Importer SELF JOIN::TrackGenre" of newRec to allGenres

set cell "CD Importer SELF JOIN::TrackLength" of newRec to allTimes

This topic is 6892 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.