0 votos

Luchando con las Subrutinas

Tengo, creo, una subrutina problema. Quiero usar este "Elegir de la lista' del sistema a fin de recién adquirido la música. Después de caer en un montón de archivos mp3, reproducir mp3 (para que pueda decidir sobre el género), a continuación, mostrar el primer 'elegir...' cuadro de diálogo, que deben dar lugar a la siguiente, hasta que llegue el que le pide el Buscador de archivos mp3. A continuación, se debe pasar a la siguiente mp3. Pero, por alguna razón, simplemente reproduce el mp3.

Alguien puede ayudar? Disculpas por la masa de código, pero pensé que podría ser útil. Tal vez me haya demasiado complicado esto... Pero supongo que me estoy preguntando es posible ir desde una 'elija de la lista de' subrutina a otra antes de saltar al siguiente archivo en la lista?

Gracias

La tardanza

property extension_list : {"mp3", "m4a", "mp4", "aac"}  
tell application "Finder"  
    --set folders as variables now...there are 15 folders  
    set f1 to POSIX file "/Users/Tardy/Tardy Stuff/Scripts & Automator Actions/Music Pre-Filing System/01 50s & 60s Rock"  
    set f2 to POSIX file "/Users/Tardy/Tardy Stuff/Scripts & Automator Actions/Music Pre-Filing System/02 70s & 80s Rock"  
    set f3 to POSIX file "/Users/Tardy/Tardy Stuff/Scripts & Automator Actions/Music Pre-Filing System/03 90s-now Rock"  
    set f4 to POSIX file "/Users/Tardy/Tardy Stuff/Scripts & Automator Actions/Music Pre-Filing System/04 Swing"  
    set f5 to POSIX file "/Users/Tardy/Tardy Stuff/Scripts & Automator Actions/Music Pre-Filing System/05 Soul"  
    set f6 to POSIX file "/Users/Tardy/Tardy Stuff/Scripts & Automator Actions/Music Pre-Filing System/06 Pop. Song"  
    set f7 to POSIX file "/Users/Tardy/Tardy Stuff/Scripts & Automator Actions/Music Pre-Filing System/07 Modern Jazz"  
    set f8 to POSIX file "/Users/Tardy/Tardy Stuff/Scripts & Automator Actions/Music Pre-Filing System/08 Comedy & Novelty & Christmas"  
    set f9 to POSIX file "/Users/Tardy/Tardy Stuff/Scripts & Automator Actions/Music Pre-Filing System/09 Spoken"  
    set f10 to POSIX file "/Users/Tardy/Tardy Stuff/Scripts & Automator Actions/Music Pre-Filing System/10 Blues, Gospel, Folk & World"  
    set f11 to POSIX file "/Users/Tardy/Tardy Stuff/Scripts & Automator Actions/Music Pre-Filing System/11 Classical"  
    set f12 to POSIX file "/Users/Tardy/Tardy Stuff/Scripts & Automator Actions/Music Pre-Filing System/12 Lounge & Exotica"  
    set f13 to POSIX file "/Users/Tardy/Tardy Stuff/Scripts & Automator Actions/Music Pre-Filing System/13 Rap"  
    set f14 to POSIX file "/Users/Tardy/Tardy Stuff/Scripts & Automator Actions/Music Pre-Filing System/14 Reggae"  
    set f15 to POSIX file "/Users/Tardy/Tardy Stuff/Scripts & Automator Actions/Music Pre-Filing System/15 Warped & Electronic"  
end tell  
--opens the dropped files  
on open these_items --these_items are the dropped ones  
    repeat with i from 1 to the count of these_items  
        set this_item to item i of these_items  
        process_item(this_item)  
    end repeat  
end open  
-- this sub-routine processes files; this is the initial menu  
on process_item(this_item)  
    -- NOTE that the variable this_item is a file reference in alias format   
    tell application "iTunes"  
        play this_item  
    end tell  
    tell application "Finder"  
        choose from list {"Rock", "Soul/Rap/Reggae", "Jazz/Pop. Song", "Other"} with title "Which genre?" with prompt "Identify genre from list:" cancel button name "Cancel"  
        if the result is {"Rock"} then  
            rockSubmenu(this_item)  
        else if the result is {"Soul/Rap/Reggae"} then  
            soulSubmenu(this_item)  
        else if the result is {"Jazz/Pop. Song"} then  
            jazzSubmenu(this_item)  
        else if the result is {"Other"} then  
            otherSubmenu(this_item)  
        end if  
    end tell  
end process_item  
--here are all the other submenus  
on rockSubmenu(this_item)  
    choose from list {"50s & 60s", "70s & 80s", "90s-Now"} with title "Which genre?" with prompt "Choose from the following categories:" cancel button name "Cancel"  
    if the result is {"50s & 60s"} then move this_item to f1  
    if the result is {"70s & 80s"} then move this_item to f2  
    if the result is {"90s-Now"} then move this_item to f3  
end rockSubmenu  
on soulSubmenu(this_item)  
    choose from list {"Soul", "Rap", "Reggae"} with title "Which genre?" with prompt "Choose from the following categories:" cancel button name "Cancel"  
    if the result is {"Soul"} then  
        move this_item to f5  
    else if the result is {"Rap"} then  
        move this_item to f13  
    else if the result is {"Reggae"} then  
        move this_item to f14  
    end if  
end soulSubmenu  
on jazzSubmenu(this_item)  
    choose from list {"Swing", "Modern", "Pop. Song", "Lounge/Exotica"} with title "Which genre?" with prompt "Choose from the following categories:" cancel button name "Cancel"  
    if the result is {"Swing"} then move this_item to f4  
    if the result is {"Modern"} then move this_item to f7  
    if the result is {"Pop. Song"} then move this_item to f6  
    if the result is {"Lounge/Exotica"} then move this_item to f12  
end jazzSubmenu  
on otherSubmenu(this_item)  
    choose from list {"Spoken", "Comedy/Novelty/Christmas", "Other"} with title "Which genre?" with prompt "Choose from the following categories:" cancel button name "Cancel"  
    if the result is {"Spoken"} then move this_item to f9  
    if the result is {"Comedy/Novelty/Christmas"} then move this_item to f8  
    if the result is {"Other"} then other2Submenu(this_item)  
end otherSubmenu  
--another other menu  
on other2Submenu(this_item)  
    choose from list {"Folk & World", "Classical", "Blues/Gospel", "Warped/Electronic"} with title "Which genre?" with prompt "Choose from the following categories:" cancel button name "Cancel"  
    if the result is {"Classical"} then move this_item to f11  
    if the result is {"Blues/Gospel/Folk"} then move this_item to f10  
    if the result is {"Warped/Electronic"} then move this_item to f15  
    --end of all submenus  
end other2Submenu  

0voto

tardy pigeon Puntos 113

Después de tontear con esto por un tiempo, me las arreglé para venir para arriba con una solución más simple. Lo voy a dejar aquí para que nadie tratando de ordenar sus archivos mediante un sistema similar. Cuando está funcionando, es mucho más rápido que manualmente haciendo clic en y buscando carpetas para ordenar las cosas en.

   --opens the dropped files
on open these_items 
--these_items are the dropped ones
    repeat with i from 1 to the count of these_items
        set this_item to item i of these_items
        process_item(this_item)
    end repeat
end open

on process_item(this_item)
    -- NOTE that the variable this_item is a file reference in alias format 
    --plays song so you can make a judgement
    tell application "iTunes"
        play this_item
    end tell
    --displays info of item to help decide genre
    tell application "Finder"
        set selectedItem to this_item
        set infoList to {}
        copy ("Displayed Name: " & displayed name of selectedItem) to end of infoList
    end tell
    set {od, AppleScript's text item delimiters} to {AppleScript's text item delimiters, return}
    set infoAsString to infoList as string
    set AppleScript's text item delimiters to od
    set the clipboard to infoAsString
    tell me to activate
    display dialog infoAsString giving up after 3.5
    --moves item
    tell application "Finder"
        set defaultFolder to alias "Macintosh HD:Users:Tardy:Tardy Stuff:Scripts & Automator Actions:Music Pre-Filing System"
    end tell
    tell application "Finder"
        choose folder default location (defaultFolder) with prompt "What genre?"
        set theDestination to result
        move this_item to theDestination
    end tell
  --stops music when sorting is complete
    tell application "iTunes"
        stop
    end tell
end process_item

Gracias por cualquier persona que estaba trabajando en una respuesta.

La tardanza

AppleAyuda.com

AppleAyuda es una comunidad de usuarios de los productos de Apple en la que puedes resolver tus problemas y dudas.
Puedes consultar las preguntas de otros usuarios, hacer tus propias preguntas o resolver las de los demás.

Powered by:

X