Old 09-08-2019, 01:01 AM   #1
Thonex
Human being with feelings
 
Join Date: May 2018
Location: Los Angeles
Posts: 665
Default UPDATED - New Script: Permanently delete many audio items with 1 warning

Hi gang,

UPDATED -- added a better delete command to delete items and not just active takes. There were cases where a lot of empty take-lanes were remaining

I couldn't find this kind of script in the action list or in SWS...

I sometimes need to be able to delete a bunch of project specific audio files permanently (as well as their peak files)... and I don't want to click "ok" on every file, and I don't want it to be without warning either. So I adapted an SWS/S&M command to do what I wanted: It erases all selected audio items, takes and source and peak files with only 1 initial warning. Also, the script will allow you to undo MIDI erasure if you selected MIDI items by mistake.

The code is below... let me know if there's something else like this. You must have SWS installed for it to work.

Code:
--[[ written by Thonex
  This will permanently erase audio file and their realted Peaks (visual waveform files) off the disk permanently.
  You must have SWS installed.
  V1.3
--]]

function Msg (param)
  reaper.ShowConsoleMsg(tostring (param).."\n")
end


function PERMANENTLY_DELETE_AUDIO_WITH_WARNINGS ()

  reaper.PreventUIRefresh(1)
  reaper.Undo_BeginBlock()

      message = reaper.ShowMessageBox( "Are you SURE you want to delete these files?? \nTHIS CAN'T BE UNDONE!", "Permanently Erase", 4 )
      --Msg(message)
      if message == 6 then
      Erase = reaper.NamedCommandLookup( "_S&M_DELTAKEANDFILE2"  )-- SWS/S&M: Delete active take and source file in selected items (no undo)
      reaper.Main_OnCommand(Erase,0) --SWS/S&M: Delete active take and source file in selected items (no undo)
      reaper.Main_OnCommand(40006,0) -- Edit Remove Items (in the event there are empty items remaining)
      end
      
  reaper.PreventUIRefresh(-1) 
  reaper.Undo_EndBlock("Permanently Erase Selected Audio",-1)
end

PERMANENTLY_DELETE_AUDIO_WITH_WARNINGS ()
__________________
Cheers,
Andrew K
v5.982/64 Mac 10.12.+, i7 Quad 2.9GHz, 24GB

Last edited by Thonex; 09-09-2019 at 11:54 AM.
Thonex is online now   Reply With Quote
Old 09-08-2019, 07:37 AM   #2
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 1,486
Default

Nice.

Have you thought about sharing it with ReaPack?
__________________
Ultraschall-API - a Lua-functions-library4Reaper: https://forum.cockos.com/showthread....98#post2067798
Reaper Internals - Developerdocs4Reaper: https://forum.cockos.com/showthread.php?t=207635
mespotine is offline   Reply With Quote
Old 09-08-2019, 09:01 AM   #3
Thonex
Human being with feelings
 
Join Date: May 2018
Location: Los Angeles
Posts: 665
Default

Quote:
Originally Posted by mespotine View Post
Nice.

Have you thought about sharing it with ReaPack?
Thanks mespotine,

Yeah... I actually have a repo... but haven't used it in a year. I'll have to revisit it and remember the tagging and everything LOL.
__________________
Cheers,
Andrew K
v5.982/64 Mac 10.12.+, i7 Quad 2.9GHz, 24GB
Thonex is online now   Reply With Quote
Old 09-08-2019, 09:25 AM   #4
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 2,725
Default

You can also use the ReaTeam upload tool at https://reapack.com/upload.
cfillion is online now   Reply With Quote
Old 09-08-2019, 11:02 AM   #5
Thonex
Human being with feelings
 
Join Date: May 2018
Location: Los Angeles
Posts: 665
Default

Quote:
Originally Posted by cfillion View Post
You can also use the ReaTeam upload tool at https://reapack.com/upload.
Nice cfillion!!

Thanks!
__________________
Cheers,
Andrew K
v5.982/64 Mac 10.12.+, i7 Quad 2.9GHz, 24GB
Thonex is online now   Reply With Quote
Old 09-09-2019, 08:24 AM   #6
Klangfarben
Human being with feelings
 
Join Date: Jul 2016
Location: Los Angeles, CA
Posts: 607
Default

Nice one!!
Klangfarben is offline   Reply With Quote
Old 09-09-2019, 09:38 AM   #7
Thonex
Human being with feelings
 
Join Date: May 2018
Location: Los Angeles
Posts: 665
Default

Updated... see OP
__________________
Cheers,
Andrew K
v5.982/64 Mac 10.12.+, i7 Quad 2.9GHz, 24GB
Thonex is online now   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 07:08 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.