Skip to content

Instantly share code, notes, and snippets.

@espenmn
Created April 23, 2023 18:49
Show Gist options
  • Select an option

  • Save espenmn/f59dbd38ee6bee4dc08de7f2af7109a8 to your computer and use it in GitHub Desktop.

Select an option

Save espenmn/f59dbd38ee6bee4dc08de7f2af7109a8 to your computer and use it in GitHub Desktop.
BND and Reaper script
--change "Users:gm:Downloads: to "Users:Jan:Desktop" or similar
tell application "REAPER" to activate
tell application "System Events" to tell process "REAPER"
tell menu bar item "File" of menu bar 1
click
delay 1
tell menu item "Project templates" of menu 1
click
delay 1
-- edit line below
click menu item "test template 2" of menu 1
delay 1
keystroke return
end tell
end tell
end tell
tell application "Finder"
activate
--First, make folder "Tracker" with subfolders "In" and "Out"
global thedate
set thedate to (current date) as string
global bndItems
#Folder to add bnd
set baseFolder to "Users:gm:Tracker" as alias
set mainFolder to baseFolder as alias
set inFolder to folder "In" of baseFolder as alias
set outFolder to folder "Out" of baseFolder as alias
set inReaperFolder to "Users:gm:Documents:REAPER Media" as alias
move every file of folder mainFolder to inFolder
set modification date of every file of folder inFolder to (current date)
set bndItems to count of files of folder inFolder
--display dialog (bndItems/2)
end tell
repeat with i from 1 to (bndItems / 2)
tell application "Tracker BND Splitter x10.6" to activate
delay 3
tell application "System Events" to keystroke "o" using {command down}
tell application "System Events"
--click "audio"
keystroke return
delay 3
keystroke return
--click button "Cancel " of sheet 1 of dialog 1
delay 3
key code 31 using control down
keystroke return
delay 10
keystroke return
delay 1
end tell
tell application "Finder"
activate
delay 2
set nameOfFolder to name of first folder of inFolder
set name of first folder of inFolder to ("# " & nameOfFolder & " " & thedate)
--move first folder of folder inFolder to outFolder
move first folder of folder inFolder to inReaperFolder
move first file of folder inFolder to outFolder
move first file of folder inFolder to outFolder
delay 2
end tell
tell application "REAPER" to activate
tell application "REAPER"
activate
tell application "System Events" to tell process "REAPER"
tell menu bar item "Insert" of menu bar 1
click
delay 1
click menu item "Media file..." of menu 1
end tell
delay 2
key code 125 --using control down
delay 2
keystroke return
delay 1
keystroke "a" using {command down}
delay 1
keystroke return
delay 1
keystroke return
delay 1
keystroke return
tell menu bar item "File" of menu bar 1
click
click menu item "Render..." of menu 1
end tell
delay 1
keystroke "Sparksify " & ((current date) as string)
keystroke return
beep 1
repeat until (exists menu bar item "File" of menu bar 1)
delay 1
end repeat
end tell
end tell
tell application "Finder"
move (every folder whose name starts with "#") of inReaperFolder to outFolder
end tell
end repeat
tell application "Tracker BND Splitter x10.6" to quit
tell application "Finder"
activate
display dialog "Done"
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment