Page 2 of 3

Re: File permission error? (mp3 encoding)

Posted: Sun Oct 21, 2007 8:35 pm
by jordyn
I was also using Max 0.7.1 for the first time, to convert downloaded FLAC files to MP3. I selected Best for MP3 and output to iTunes, but made no other changes. Got the same intermittent iTunes file permission error.

MacBook Pro, OS 10.4.10, iTunes 7.4.2

Re: File permission error? (mp3 encoding)

Posted: Mon Dec 03, 2007 9:48 pm
by shaun3000
I found this on the iLounge forums. I don't know if it's the same problem or not: ... quote]This is a reported error and has been fixed in Join Together v5.1.2, to be released on April 5, 2007.

The -54 is a file open error. iTunes is too busy examining the just-added joined file for volume information, so that the routine in Join Together that applies tags cannot be completed. The fixed version waits for iTunes to finish this process and then applies the tags after iTunes closes the file.[/quote]

Re: File permission error? (mp3 encoding)

Posted: Fri Dec 21, 2007 4:10 pm
by BolivarBaLues
I was really disappointed upon awaking this morning to discover that the hundreds of FLAC files I had hoped would be converted to MP3 and added to my iTunes library were still in queue because I apparently have to acknowledge the permissions error before Max will proceed. What a drag. But I seem to have resolved this problem. I know nothing about programming, Apple Script or really anything to with computers, but logic tells me that if your right eye offends, then lop the bastard off. So in this case, it is the process of tagging the file that results in a permissions error. Ergo, I trashed the part of the "Add To iTunes Library" AppleScript that appears to deal with tagging the files.

if album_name is not equal to "" then
set album of audio_item to album_name
end if

if artist_name is not equal to "" then
set artist of audio_item to artist_name
end if

if composer_name is not equal to "" then
set composer of audio_item to composer_name
end if

if genre_name is not equal to "" then
set genre of audio_item to genre_name
end if

if track_year is not equal to 0 then
set year of audio_item to track_year
end if

if comment_string is not equal to "" then
set comment of audio_item to comment_string
end if

if track_title is not equal to "" then
set name of audio_item to track_title
end if

if track_number is not equal to 0 then
set track number of audio_item to track_number
end if

if track_total is not equal to 0 then
set track count of audio_item to track_total
end if

if is_compilation is not equal to no then
set compilation of audio_item to is_compilation
end if

if disc_number is not equal to 0 then
set disc number of audio_item to disc_number
end if

if disc_total is not equal to 0 then
set disc count of audio_item to disc_total
end if

I deleted all of the above (after renaming the original script to "Add to iTunes Library.scpt.old" just in case I needed to backtrack) and saved the modified script. Voila! Works like magic. There may be some function that is important to someone out that that suffers as a result of this modification, but for my needs everything works just fine. The tags I enter into the "metadata" fields appear in the file and even the album art works. So apparently all of that bit I hacked off of the script was not necessary in the first place, and was just mucking up the process with permissions errors.

Re: File permission error? (mp3 encoding)

Posted: Sat Dec 29, 2007 7:54 pm
by kwbrown
I have solved this problem by editing Add to iTunes Library.scpt to add a delay before doing any tagging:

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)

delay 10

if playlist_name is not equal to "" then
set the_playlist to my get_playlist(playlist_name)
duplicate audio_item to the_playlist
end if

A 10 second delay seems to work just fine on my MBP, although I think the delay could be significantly shortened to like 2-3 seconds. I've never used Applescript before, so there may be a better way to fix this problem. I tried to use the method that Join Together used to solve this problem, but I was unable, as it is closed source. A better fix would be to wait for iTunes to finish importing the file.

Re: File permission error? (mp3 encoding)

Posted: Sun May 18, 2008 11:54 am
by db
If you uncheck iTunes -> Add output files to iTunes library you can avoid this problem (but then you have to manually add the encoded tracks).

However, it is very annoying and should be fixed. I will have a look at the script that performs the actual adding and see if I can figure out the problem.


Re: File permission error? (mp3 encoding)

Posted: Sun May 18, 2008 3:33 pm
by RonaldPR
Is this problem still in Max 0.8.1? With Max 0.8.1 I have recently converted from flac to mp3 15 albums with a total of 262 tracks in one batch, letting Max add the tracks directly to iTunes, and I have not encountered the problem.
(Alu Intel iMac with 10.4.11)

Re: File permission error? (mp3 encoding)

Posted: Sun Jun 15, 2008 12:31 am
by bhawkins
I'm getting this error in Max 0.8.1 on OS X 10.4 with iTunes 7.6.2 (9). The tweak from kwbrown works every time at 3 seconds (and there is no delay in net encoding time, because each track is handled on a separate thread). I think this delay ought to be part of the dist, if there is no real solution to the iTunes API bug that is causing the error.

Thanx for the nice util. :D

Re: File permission error? (mp3 encoding)

Posted: Tue Mar 31, 2009 2:25 pm
by siginx75
Hi all,

I'm new to the forum, but I use Max quite a lot. I'm getting the same file permission error. I'd like to try kwbrown's solution, but I'm having trouble locating "Add to iTunes Library.scpt". I've searched my iTunes folders and all of my computer using Finder, but I can't locate that .scpt file. Either I'm not looking hard enough, or the file isn't there to begin with (do I have to download it from somewhere?). Any help is appreciated. Thanks!

Re: File permission error? (mp3 encoding)

Posted: Tue Mar 31, 2009 2:51 pm
by RonaldPR
It is inside Max application package: to iTunes Library.scpt

Re: File permission error? (mp3 encoding)

Posted: Tue Mar 31, 2009 4:50 pm
by siginx75
Great, I'll take a look. Funny that Finder didn't locate it.

Many thanks.

Re: File permission error? (mp3 encoding)

Posted: Tue Mar 31, 2009 7:01 pm
by RonaldPR
If you want the Finder to show files inside a package, you need to choose 'Show Package Contents" from the contextual menu. A search in the Finder will not find files that the average user is supposed to keep his hands off, so it will not find package contents (and not most System files either.)

Re: File permission error? (mp3 encoding)

Posted: Tue Mar 31, 2009 9:53 pm
by siginx75
Gotcha. I'll check things out when I get home. Thanks again.

Re: File permission error? (mp3 encoding)

Posted: Fri Apr 24, 2009 7:44 pm
by Fuga
Am I right? This has been a known problem but since the fix was found in 2007 (by a user) there has been no fix to the app so that we all don't have to do it ourselves? I have never done the auto add to iTunes thing until now (April, 2009) only to get bit by it. Am using the latest v.8.1 from October '08.

Someone please tell me I'm wrong and point me somewhere else. I'm certainly capable of editing the script but between my fat fingers and some rum it'd be better for someone else to do it so we don't all stumble over ourselves.

Re: File permission error? (mp3 encoding)

Posted: Sat Apr 25, 2009 11:51 pm
by zorzal
April 25, 2009. The problem is still there, and it unbelievable obnoxious... The scenario should be quite common: lots of us have arge numbers of .flac or .ape files that need conversion, lots of us want to have them inside iTunes. Further, looking at Max's implementation, it looks like it was designed precisely for such scenarios, where a large number of files is selected, settings are chosen, conversion started... and go get sleep, or coffee, or whatever...

From what a user found, this is not rocket science, since even I can understand what the code changes say... Can I please request that this issue were bumped up in priority? Please understand other users' trepidation at editing the script, I feel like I may be braking a zillion other things that I don't know about.

Thanks for your efforts, guys, you are doing an awesome job with Max! :D

Re: File permission error? (mp3 encoding)

Posted: Sun May 17, 2009 6:55 pm
by sounddroid
OK, I finally figured this out. If you simply disable "Sound Check" in the Playback preferences in iTunes, you won't get this error. You only have to disable it while you're doing a conversion with MAX - once it's done converting and importing into iTunes, you can turn it back on. Must have something to do with iTunes and MAX trying to write to the file at the same time.