Hello,
I recently created this applescript in order to update my iTunes Music library automatically upon file transfer, with updating the ID3 tags of the mp3 music files that are transferred to the folder running the applescript.
property dialog_timeout : 30 -- set the amount of time before dialogs auto-answer.
on adding folder items to this_folder after receiving added_items
repeat with i from 1 to number of items in added_items
try
tell application "Finder"
set this_file to (item i of added_items)
set p to POSIX path of this_folder
set filename to name of this_file
--display dialog filename
do shell script "cd " & quoted form of p & ";id3edcmd -cf pwd.log " & quoted form of filename
end tell
end try
tell application "iTunes"
launch
try
set this_file to (item i of added_items)
add this_file
(*
-- if you have iTunes set to
--"Copy files to iTunes Music folder when adding to library"
-- then you might want to delete the original file...
-- if so, remove comments from this block and
-- use the UNIX commands below to delete the file
set the file_path to the quoted form of the POSIX path of this_file
do shell script ("rm -f " & file_path)
*)
end try
end tell
end repeat
end adding folder items to
The concept is that in the first section the ID3 tag is updated and then the file is added to iTunes.
This is done for all the files added to the folder from repeat function.
And now, we come to the problem:
It seems that sometimes the script is not triggered. Particularly, when I file transfer a bunch of mp3’s to the folder, the script does not run for all the files. Some of them are skipped. After that being done, from that point on, the script is not triggered, whenever or from whatever folder i trigger it.
From what I’ve seen so far, the only way to overcome this problem is to restart my MacBook.
Should I change something at my script to enhance it, is there a bug involved?
thanks in advance for any help
br,
Dimitris