Set newFilename to ( characters 1 thru -4 of partFilename as string) & " " & newDuplicate & ". Repeat while fileExists( POSIX file newFilepath) Set newFilepath to replaceText(partFilename, newFilename, partFilepath) Set newFilename to ( characters 1 thru -3 of partFilename as string) & "m4v " Tell application "Finder " to set partFilename to name of partFile Set partFile to ( POSIX file partFilepath as alias) Tell application "Finder " to set label index of currentFile to 6 Set the label to green in case file deletion fails Set shellCommand to "nice " & handbrakeLocation & " -i ' " & origFilepath & "' -o ' " & partFilepath & "' -preset='High Profile' " & " // &> ' " & logFilepath & "' " Set partFilepath to ( characters 1 thru -5 of origFilepath as string) & " " & partDuplicate & ".hb " Repeat while fileExists( POSIX file partFilepath) Set partFilepath to ( characters 1 thru -5 of origFilepath as string) & ".hb " The default storing location is: Windows 7: usernameMusiciTunes. Try and find a unique filename by appending a number to the end if necessary Go to File Add File to Library to add the MP3 files to your iTunes library. Set logFilepath to ( characters 1 thru -5 of origFilepath as string) & ".log " Tell application "Finder " to set origFilepath to POSIX path of (currentFile as alias) Tell application "Finder " to set label index of currentFile to 7 Set to gray label to indicate processing If label index of currentFile is not 0 then exit repeat Only process files that aren't being or haven't been processed Repeat with i from 1 to number of items in allFiles Set allFiles to every file of entire contents of ( POSIX file torrentsLocation as alias) whose (( name extension is "avi " or name extension is "mkv ") and label index is 0) Get all AVI and MKV files that have no label color yet, meaning it hasn't been processed Set isRunning to segmentedActivityLog contains "HandBrakeCLI " Set segmentedActivityLog to ( every word of activityLog) Set activityLog to do shell script "/bin/ps -ax " Determine if HandBrakeCLI is already running Set text item delimiters of AppleScript to prevTIDs Set text item delimiters of AppleScript to replace Set text item delimiters of AppleScript to find Set prevTIDs to text item delimiters of AppleScript If not (exists posixFile as alias) then return false Set handbrakeLocation to "/Applications/Utilities/HandBrakeCLI " Set the location for where HandbrakeCLI lives Set torrentsLocation to "/Users/Jelly/Torrents " Set the location for where your torrents download to
0 Comments
Leave a Reply. |