質問

I am trying to rebuild a script that will add the meta tag to songs in iTunes to bring up the explicit or clean tag... Basically i have a exec file that will do it.. (AtomicParsley) in terminal i have to put the path of atomic parsley followed by the path of the music file that i want to change followed by --advisory explicit --overWrite..

so it would look something like Users/G/Downloads/AtomicParsley-MacOSX-0.9.0/AtomicParsley /Volumes/Drive2/iTunes/iTunes Media/Music/Adele/21/01 Rolling in the Deep.m4a --advisory explicit --overWrite option

I am trying to use automator which would pass the location of AtomicParsley into the applescript.. this is what i have so far.. But i can't get it to locate AtomicParsley which is passed into the script

on run {input, parameters}
    set AtomicParsleyPath to POSIX path of input

    tell application "iTunes"
        set selectedTracks to location of selection

        repeat with selectedTrack in selectedTracks
            set trackPath to POSIX path of selectedTrack
            #   display dialog trackPath
            set the command to quoted form of AtomicParsleyPath & " " & quoted form of trackPath & " --advisory explicit --overWrite"
            #       display dialog(the_command)
            do shell script the_ repeat
    end tell
end run
役に立ちましたか?

解決

You can specify the location of AtomicParsley within the script:

on run {input, parameters}
    set AtomicParsleyPath to "/Users/G/Downloads/AtomicParsley-MacOSX-0.9.0/AtomicParsley"

    tell application "iTunes" to set selectedTracks to location of selection

    repeat with selectedTrack in selectedTracks
        tell application "iTunes" to set trackPath to POSIX path of selectedTrack
        #   display dialog trackPath
        set theCommand to quoted form of AtomicParsleyPath & space & quoted form of trackPath & " --advisory explicit --overWrite"
        #       display dialog(the_command)
        do shell script theCommand
    end repeat
end run
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top