Code: Select all
tell application "Max"
activate
convert...
end tell
Any help is appreciated!
Nate
Code: Select all
tell application "Max"
activate
convert...
end tell
Code: Select all
set my_file to alias "Media Drive 200GB:Music:iTunes:iTunes Music:Barenaked Ladies:Stunt:01 One Week.m4a"
tell application "Max"
activate
set output_format to "MPEG 4 Audio"
set encoder_settings to "AAC m4a 96k maximum"
set output_folder to "..."
convert my_file using output_format encoder_settings to output_folder
end tell
Code: Select all
tell application "Max"
(set "theFile" to valid WAV file)
convert theFile
end tell
Code: Select all
tell application "Finder"
set theFile to choose file
tell application "Max"
activate
convert theFile
end tell
delay 1
tell application "System Events"
tell process "Max"
click button "Convert" of tool bar of window "File Conversion"
end tell
end tell
end tell
Code: Select all
--
-- Use GUI scripting to convert a file in Max
--
-- script waits for conversion to finish before quitting
---
tell application "Finder"
set theFile to choose file
tell application "Max"
convert theFile
end tell
delay 1
tell application "System Events"
tell process "Max"
-- Start conversion
click button "Convert" of tool bar of window "File Conversion"
--Use error trap to check is Encoder is still open
set encoderOpen to true
repeat while encoderOpen is true
try
window "Encoder"
on error
set encoderOpen to false
end try
end repeat
end tell
end tell
end tell
Thankssbooth wrote:That's pretty slick. It's a nice workaround for the somewhat lacking AppleScript support in the current version of Max.
Code: Select all
tell application "Max" to activate
tell application "Finder"
set sourceFolder to choose folder
set theFiles to (every file of sourceFolder whose name extension is "MP3") as alias list
repeat with aFile in theFiles
tell application "Max"
convert aFile
end tell
delay 1
tell application "System Events"
tell process "Max"
click button "Convert" of tool bar of window "File Conversion"
set encoderOpen to true
repeat while encoderOpen is true
try
window "Encoder"
on error
set encoderOpen to false
end try
end repeat
end tell
end tell
end repeat
end tell
Code: Select all
on open targetFiles
tell application "Finder"
repeat with targetFile in targetFiles
if (kind of targetFile is "Folder") then
-- process folder
processFolder(targetFile) of me
else
processFile(targetFile) of me
end if
end repeat
end tell
-- Convert the files
tell application "System Events"
tell process "Max"
click button "Convert" of tool bar of window "File Conversion"
set encoderActive to true
repeat until encoderActive is false
try
window "Encoder"
on error
set encoderActive to false
end try
end repeat
end tell
end tell
end open
on processFolder(theFolder)
tell application "Finder"
set theFolders to every folder of theFolder
repeat with aFolder in theFolders
processFolder(aFolder) of me
end repeat
set theFiles to every file of theFolder
repeat with aFile in theFiles
processFile(aFile as string) of me
end repeat
end tell
end processFolder
on processFile(theFile)
--display dialog (theFile as string)
tell application "Max"
convert theFile
end tell
end processFile