hi all,
I look for a custom action to add a folder to my iTunes Library.
I tried to write my own action, but it doesn't work.
Can someone help me?
Thanks in advance fot the help.
here's the applescript code I copied from the net and modified:

on open these_items
        set these_paths to ""
        set the counter to 0
        repeat with i from 1 to the count of these_items
                set this_item to item i of these_items as alias
                set the item_info to info for this_item
                if folder of the item_info is true then
                        process_folder(this_item as alias)
                else if (alias of the item_info is false) and ((the file type 
of the
item_info is in the type_list) or the name extension of the item_info
is in the extension_list) then
                        process_item(this_item as alias)
                end if
        end repeat
        my growlRegister()
        growlNotify("Add To iTunes Library", (the counter as string) & "
items have been added to the iTunes library.")
end open

property type_list : {"MPG3", "MIDI", "AIFF"}
property extension_list : {"mp3", "mid", "aif", "wav", "m4a"}

global counter, source_folder, selection_list, these_items

-- this sub-routine processes folders
on process_folder(this_folder)
        set these_items to list folder this_folder without invisibles
        repeat with i from 1 to the count of these_items
                set this_itemPath to this_folder & (item i of these_items) as 
string
                set this_item to this_itemPath as alias
                set the item_info to info for alias this_itemPath
                if folder of the item_info is true then
                        process_folder(this_item)
                else if (alias of the item_info is false) and ((the file type 
of the
item_info is in the type_list) or the name extension of the item_info
is in the extension_list) then
                        process_item(this_item)
                end if
        end repeat
end process_folder

-- this sub-routine processes files
on process_item(this_item)
        tell application "iTunes"
                launch
                add this_item to playlist "Library" of source "Library"
        end tell
        set counter to counter + 1
end process_item

using terms from application "GrowlHelperApp"
        on growlRegister()
                tell application "GrowlHelperApp"
                        register as application "Add to iTunes Library" all 
notifications
{"Alert"} default notifications {"Alert"} icon of application "iTunes"
                end tell
        end growlRegister

        on growlNotify(grrTitle, grrDescription)
                tell application "GrowlHelperApp"
                        notify with name "Alert" title grrTitle description 
grrDescription
application name "Add to iTunes Library"
                end tell
        end growlNotify
end using terms from

Reply via email to