Max

iTunes got an error: File permission error.

Bug #368342 reported by Maurice Weitman
10
Affects Status Importance Assigned to Milestone
Max
Confirmed
Undecided
Unassigned

Bug Description

Howdy,

Thanks for Max! He's cool!!!

There's something erratic about how Max adds converted (in this case FLAC to MP3) files to iTunes.

After each file converted, it adds it properly to iTunes (most of the time -- I haven't been able to reproduce failures), but displays this error message "An error occurred while tagging the file -- iTunes got an error: File permission error." to which it would like me to say "OK" before it moves onto the next file.

Running Max 0.8.1 on a MacBook Pro with Leopard 10.5.6. Plenty of RAM and disk space.

Repair disk perms reports no probs.

"Use iTunes Compatibility Mode" and "Add files to iTunes Library" are checked.

Regards,
Maurice

Revision history for this message
Robert Munro (rjmunro) wrote :

I sometimes get that error, and other times get the following:
iTunes got an error: A descriptor type mismatch occurred.

Just occasionally, (but not very often) it works without problem.

Revision history for this message
KelchM (kelchm) wrote :

I ran into this problem today while trying to convert some files to MP3s.

I did a little bit of playing around and the problem stems from iTunes trying to access the file too quickly. Take a look at the "Add to iTunes Library" script in the resources folder. All you need to do is add a delay of 2 seconds right before all the metadata stuff...

IE:
...
set audio_item to (add audio_file to library_source)

delay 2

if playlist_name is not equal to "" then
...

Changed in maxosx:
status: New → Confirmed
Revision history for this message
Maurice Weitman (mac-mo333) wrote :

That's very encouraging, and I'd love to modify the script as you suggest, but I can't find it on my machine!

Nor do I have a "resources" folder in my Max folde.

I downloaded Max again and it didn't unpack anything like resources or scripts.

Can you point me to the right place?

Thanks again.

Regards,
Maurice

Revision history for this message
KelchM (kelchm) wrote :

Find Max in your application folder... Right click it and select show package contents. Next, browse to contents then resources. You will find the script in this folder.

Revision history for this message
Maurice Weitman (mac-mo333) wrote :

Duh. Of course. Thanks!!!

Best,
Maurice

Revision history for this message
Asbjørn Ulsberg (asbjorn-ulsberg) wrote :

Indeed, adding "delay 2" to "Max.app/Resources/Add to iTunes Library.scpt" fixed this issue.

Revision history for this message
Asbjørn Ulsberg (asbjorn-ulsberg) wrote :

Actually, "delay 5" fixed it. Seems like a 2 seconds delay wasn't enough.

Revision history for this message
KelchM (kelchm) wrote :

Yeah, I should have noted the delay may need to be modified to match the performance of the drive the file is being written to. For example, if this is an external drive you very well need to increase the time.

I'm wondering if there is a cleaner way to implement a fix for this problem. Any input on this Mr. Booth?

Revision history for this message
Maurice Weitman (mac-mo333) wrote :

Greetings,

Emboldened by the recent release of Max 0.9.1 and the stories of successes with the "delay 2" fix, I gave it a whirl.

My Add to iTunes Library.scpt had the delay fix:
[...]
   set audio_item to (add audio_file to library_source)

  delay 2

  if playlist_name is not equal to "" then
[...]

I tried changing it to 5, and then 10 with no luck.

The only way I was able to avoid the error was to quit iTunes before Max began converting (and if the timing was right, between files) for one file.

Otherwise, same error every time.

I'm happy to believe that this is unique to me and my perhaps unique config (at this point a new MacBook Pro, 10.5.8), but I'd love to find a way to make this work.

Thanks.

Regards,
Maurice

Revision history for this message
Jan Visser (starquake) wrote :

Is there an AppleScript guru who can change the script, so that it will try every second for like 10 times?

If not I might give it a shot...

Revision history for this message
KelchM (kelchm) wrote :

Hey guys.

Made a discover about this. There is no point to using the iTunes compatibility mode anymore. This was a workaround to fix the compilation and genre tags not showing up in iTunes in the past. Apparently this was no longer an issue in recent versions (8.0+?).

So, forget about the script, just uncheck 'Use iTunes compatibility mode' in settings.

Revision history for this message
Jan Visser (starquake) wrote :

That works perfectly! Thanks!

Revision history for this message
Jan Visser (starquake) wrote :

It seems it still happens even though I have 'Use iTunes compatibility mode' unchecked. I'm pretty sure the cause is iTunes doing a soundcheck after the file is imported. But I don't want to disable the sound check feature of iTunes. So is there another way to fix this?

Revision history for this message
Jan Visser (starquake) wrote :

It seems unchecking 'Use iTunes compatibility mode' doesn't work. I removed my preferences and reinstalled max but the error was still there.

I changed the function in the apple script like this:

on add_file_to_itunes_library(filename, playlist_name, album_name, artist_name, composer_name, genre_name, track_year, comment_string, track_title, track_number, track_total, is_compilation, disc_number, disc_total)

 set audio_file to alias (POSIX file filename)
 tell application "iTunes"

  set library_source to first source whose kind is library
  set audio_item to (add audio_file to library_source)
  set result to audio_item
 end tell
end add_file_to_itunes_library

And now it seems to work... I'll investigate it further...

Revision history for this message
Asbjørn Ulsberg (asbjorn-ulsberg) wrote :

As adding a delay after "set audio_item to (Add audio_file to library_source)" seems to be working rather consistently, couldn't this be added as a default to the script, at least as a workaround until a more elegant solution has been found? It's a bit annoying having to edit the script manually every time Max is (re-) installed.

PS: I've had to increase the delay to 15 seconds to be on the safe side now. Even with 5 I got some errors occasionally, so adding a delay is obviously not an optimal solution, but it's better than no solution at all.

Revision history for this message
Lætitia A Delvaux (ntw0nlaeti) wrote :

Unchecking the 'Use iTunes compatibility mode' is not enough to get rid of those error messages. Apparently Max still passes this information to the script. However, removing all the code that deals with changing track properties from within iTunes is the best way to go, as this old compatibility feature is not needed anymore (see comme #11).

For the one who wants to try, here is a corrected script you can put in the Resources directory inside Max, it should work ok to add converted files to iTunes. Tested on OSX 10.7.2, iTunes 10.5 and Max 0.9.1.

Revision history for this message
Alan B (amblue02) wrote :

Antoine - Where is the Resources directory inside of Max? I downloaded the script but don't know how put into the Resources directory.

Revision history for this message
Maurice Weitman (mac-mo333) wrote :

Alan B: Control-click on the Max application, select "Show Package Contents." The Resources directory is within Contents.

Antoine: your corrected script works perfectly. Thanks!!! I previously had to increase the pause to an intolerable amount to accommodate heavily-loaded conditions, but your script allows Max to fly.

Thanks again.

Regards,
Maurice

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.