The database is of sound effects which I have on CD. I have now ripped these CDs on a drive and want to put one of the fields from the database, which has info about each sound effect, into the Finder Comments of the ripped file.
Other fields in the database have the track number which is what each file name is based on and the disc number which is what the folder name is based on.
So my plan would be to have some sort of test which matches the file name with the appropiate field record and then to copy the info field into the File comments and repeat with the next record and file.
So to answer your question the name of the file.
Hope that is clearer and thanks for the prompt reply.
Since this is one off, you don’t need to add too much to the script. Open you database in FMP, make sure all the records are showing, then run this script. This assumes that your source folder is on your desktop and named “Source” (modify accordingly) and that each record has a field for the comment and the file name associated with it (again, modify the cell names appropriately):
It nearly works but not quite. I created a special field in the database to match the names that iTunes creates when ripping the CDs. Used that field name in your script and replaced the other items and then did a sort in FMP so I only had the records for CD1 showing and ran the script. It worked but for some reason it put the data from CD8 instead of CD1 into the Finder Comments. It may be that CD8 was first to be put into the original database, its too long ago to remember, but the script seems to ignore the displayed records in the database.
OK Got this to work with a copy of BBC Disk 1 on the Desktop!! by working with a script from within FMP and writing an FMP script simply calling Finder to write the Comments bit. This solved the getting the wrong CDs data.
Go to Record/Request/Page[ First ]
Perform AppleScript [ Script Attachability: Script Text:
“set source_folder to (((path to desktop) as string) & “BBC Disk 1:”)
set the_comment to cell “Findfield” of current record
set the_file_name to cell “Track no Title” of current record
tell application “Finder” to set comment of file (source_folder &
the_file_name) to the_comment” ]
Go to Record/Request/Page
[ Next, Exit after last ]
Now the only thing I need to nail is setting the path to the actual folders on
the Storage 2 drive and I have cracked it!
I have tried:-
Network:Storage 2 etc
Changing the ‘path to desktop’ to ‘path to network’
set source_folder to “Storage 2:Sound Effects:Unknown Artist:BBC Disk 1:”
All don’t work
The files are on Storage 2:Sound Effects:Unknown Artist:BBC Disk 1 which is
obviously mounted on the machine I am running FMP on.
I solved this problem by installed a copy of FMP on the machine with ‘Storage 2’ in it and worked from that.
Then the normal format worked for the path to the files so the line:-
set source_folder to (“Storage 2:Sound Effects:Unknown Artist:BBC Disk 1:”)
Now found the files correctly.
Next I FMP scripted the process of selecting the correct disc and also amending the folder number in the Applescript part so all I have to do now is enter the disc number into a Global field on a special layout and run the script.
I obviously could automate the disc number so after the script ran it would increment the disc number by one and go round again but as this this is a one off I have called it quits at this point.