Advertisement
Guest User

ExportMusic file selector

a guest
May 30th, 2019
378
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. on run {input, parameters}
  2.     set ALACFiles to {}
  3.     set otherFiles to {}
  4.     tell application "iTunes"
  5.         repeat with theTrack in tracks of playlist "Exports"
  6.             set filePath to POSIX path of (location of theTrack as alias)
  7.             if kind of theTrack is "Apple Lossless audio file" then
  8.                 set ALACFiles to ALACFiles & {filePath}
  9.             else
  10.                 set otherFiles to otherFiles & {filePath}
  11.             end if
  12.         end repeat
  13.     end tell
  14.     -- set value of variable "ALACFiles" of front workflow to ALACFiles
  15.     set value of variable "OtherFiles" of front workflow to otherFiles
  16.     display notification ("" & (count of ALACFiles) & " converting / " & (count of otherFiles) & " copying.") subtitle "Export audio files"
  17.    
  18.     set ffmpegAndDestinationFolder to value of variable "DestinationFolder" of front workflow
  19.     set value of variable "DestinationFolder" of front workflow to {second item of ffmpegAndDestinationFolder}
  20.     return ffmpegAndDestinationFolder & ALACFiles
  21. end run
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement