Test/use my scripts at your own risk. While it is atypical that a REAPER Lua script would damage or harm your hardware/software/data, I will not accept any liability if this were to occur. The download, installation, and operation of my scripting code and its structures are strictly an operative of free will, and signify an agreement to these terms. You are responsible for any damages that might occur, however unlikely. All my scripts are licensed as GPL v.3.
Hey everybody!
Script testing.. Do so at your own risk.
This script is designed to assist in the editing and processing of REAPER's items. This script includes a GUI that shows a layout of information regarding your current selection of media items.
In order to perform any of the script-actions--'group,' 'replace,' 'rename,' or 'quantize,'--you must first select items within the GUI list by clicking on them. Items may be unselected at any time by clicking on them again, and you can also select/deselect all items in the GUI list by pressing Ctrl+a while the script GUI has mouse-cursor focus. If you click and hold on a listed item, you can mass select/deselect by dragging mouse cursor either up or down.
NOTE:
In order for the colorize features in this script to operate properly, 'Tint media item background to item color' setting under Appearance>Peaks/Waveforms must be enabled.
FIELD EDITING:
With any number of items selected in your GUI list, right-click while hovering the mouse in the section of the desired value you would like to edit (e.g., track, take name, src. pos., pos., len., group ). All items selected will receive the input of a successful data entry.
The script requires Reaper [5.979], SWS/S&M [2.10.0], and js_ReaScriptAPI [.987].
The script started out as simply me wanting a quick script where I could detect if two items were of the same source, or if they were identical items, on the fly. I've included a handy-dandy toolbar icon with the script as a bonus!
Release Log: [v1.01]
*Removed Bug when selecting MIDI items
*Buffed documentation
[v2.0]
*Added menus system
*Added display hierachy capabilities
*Feature: 'search' function (req. by lachinhan)
*Feature: item replacement, item naming, and item quantization capabilities (req. by lachinhan)
*Overhauled GUI
[v2.01]
*Added replacement capabilities for groups (limited)
*Added undo points for non-colorization actions (use 'reset color/selection' to undo any colorization actions)
*Buffed documentation
*minor bug removal
[v2.1]
*Added proper reset for item colors when changing selection and exiting script
*Feature: 'select/deselect all items' action button
*Added color gradient to hierarchy display
*Improved color contrasting of colorization actions and removed previous 'mode' limitations
*Removed bugs from 'search' function and increased utilitarian intelligence
*Removed empty-item bug selection bug
*Simplified copy/replace menu options (same functionality, removed redundancy)
[v2.2]
*Added center-formatting to text
*Added column-width customization and memory (req. by musicbynumbers)
*Added: Highlight items listed in GUI when mouse is hovering over selected items in arrange
*Added: Hold left-click on +/- font button for continuing adjustment
*Feature: colorize action to colorize selected (GUI selection) items
*Feature: right-click to edit selected item(s) data field (track, take name, src, pos, len, group)
*Feature: rename item and include track name
*Improved color contrast of colorization features (again)
*Redesigned and reconstructed GUI
[v2.21]
*Feature: font-style options (req. by JamesPeters)
*Fixed item colorization bug
I really like the idea, but I tried to use and load it in one of my projects and ended up with:
Dfk Workflow; Item; Reader.lua:260: attempt to perform arithmetic on a nil value (local 'q')
Anz idea?
I really like the idea, but I tried to use and load it in one of my projects and ended up with:
Dfk Workflow; Item; Reader.lua:260: attempt to perform arithmetic on a nil value (local 'q')
Anz idea?
I am on a MacBookPro using 10.13.6
HoJo
Let me double check the code...
I'll get back to you in a jiffy.
[ADD.] Me thinks I figured it out. Running a test, then I'll post a new.
[ADD.] I think its sorted now, I've updated the file attached to the original post... Please let me know if otherwise?
I wish you Update Item management feature, rename item, Search and replace Item .....
Thank you for this
Rename item is a great idea...Let me work on that.
Do you mind explaining your search-and-replace idea a little further?
I assume you are referring to a text-based search-field to narrow down the Item Reader's display (also a good idea), but how would 'replace' work? I could add a feature where any item that is highlighted by the script could be replaced by an item of your choosing. Would that work?
Rename item is a great idea...Let me work on that.
Do you mind explaining your search-and-replace idea a little further?
I assume you are referring to a text-based search-field to narrow down the Item Reader's display (also a good idea), but how would 'replace' work? I could add a feature where any item that is highlighted by the script could be replaced by an item of your choosing. Would that work?
I was thinking for name replacement to have 3 different options, according to selection:
*Replace name(s) and include track number(s)
**Replace name(s) and include item number(s)
***Replace name(s)
Whaddya think, am I missing anything blatant or obvious?
[ADD, 7-12]
Working on adding a few new features to the script, but it's gonna take a little time. The code has gotten too muddy so I'm in the process of optimizing before I continue.
I'm trying to add:
*A search bar
*Hierarchy system for display
*Support for edit-groups
*Mass item renaming
*Mass item replacement
[Update, 7/19/2019]
This script has taken me far longer to complete than I ever would have thought, but I'm close to releasing a beta for a 2.0 version.
I've included most everything I mentioned previously^, with exception of group-editing support (which would be an awesome feature): I've decided it to remove it from the current WIP, due to complications.
Other than that, I've overhauled the GUI... and pretty much recoded the entire script along the way.
I hope to upload a 2.0 beta within a few days; once again, sorry about the wait!
Version 2.0 beta is out for testing. Please be a little (more) patient for documentation, it's taken me almost every bit of (cough) spare time I've had lately to assemble the script, but my next step is to create documentation and to really crank down on bug-testing.
Any bug-testing is really, really appreciated but please note: do so at your own risk! I'm not aware of any code that should crash your machine, but I haven't done any testing on the script besides from the windows PC on which I've been compiling it.
Hello DFK !
thank you for vesting your time into this script
will try it out today !
zook
Thanks Zook. I look forward to any questions, comments, or even (yikes!) bug-reports. I hope you enjoy the script, or find some benefit from it.
Just a word about the video I mentioned in my previous post: It's behind schedule, unfortunately. Hopefully I'll have something by this weekend.
[ADD 7/18/19]
Video is being pushed back, because I ran into a little behavior that I'm not really liking. I hope I don't run out of steam on this script because I kinda like it, plus, there's always the concern of my having to find/make spare time to work on this kinda stuff.
[Add., 4 Aug]
I've had a certain amount of success with a particular behavior that's given me quite a bit of trouble.
I plan on releasing a 2.1 version within a matter of a few weeks (I hope sooner).
Upon successful compilation of 2.1 I still fully plan to record and post a tutorial/feature video.
Video finally done! I know it's not fancy and definitely not anything that was worth waiting for, but I said I was going to post a video and by golly here it is.
The video is accompanied by the release of v2.10, a version I've been spending a lot of spare time on for probably the last 2 weeks, on and off!
Feedback, comments, concerns, bugs, glitches, problems with your love-life?
Only just got round to looking at it and seems very useful thanks!
My one question/request at the moment. Is there any way to resize the width of the columns so I can see the whole name of the item for instance?
I guess I could make the font smaller but is there a way I'm missing?
Thanks!
__________________ subproject FRs click here note: don't search for my pseudonym on the web. The "musicbynumbers" you find is not me or the name I use for my own music.
Is there any way to resize the width of the columns so I can see the whole name of the item for instance?
Thanks!
I gave it a shot.
If it works correctly on your computer (it works on mine), it should now be capable of column-width adjustment and even memorizing column-width state. I also tried a technique that hopefully should change the mouse cursor when you are adjusting columns.
Please let me know if it works, and/or it needs to be improved!
I gave it a quick try now with loading and reloading without quitting reaper and seems to work great so far
I'm a bit confused on how the search function works as it doesn't seem to do anything when I type in a word in the box that is only in some of the selected items.
I was expecting it to either select the matching ones or hiding the not matching ones.
Maybe I can't see the highlighting? Due to theme or windows settings? (dark mode matter?)
__________________ subproject FRs click here note: don't search for my pseudonym on the web. The "musicbynumbers" you find is not me or the name I use for my own music.
I'm a bit confused on how the search function works as it doesn't seem to do anything when I type in a word in the box that is only in some of the selected items.
I was expecting it to either select the matching ones or hiding the not matching ones.
It works slightly different than that... I'm open to changing its behavior but first let me explain to you how it currently works...
Here is a basic image with the 'TRACK' section alphabetically descending:
Then, after inputting the word "snare" into the search box, all tracks with the keyword "snare" are prioritized at the top of the list inside the GUI:
hmm. Maybe that's a good thing Will try it out when I get the chance and see how it feels thanks.
__________________ subproject FRs click here note: don't search for my pseudonym on the web. The "musicbynumbers" you find is not me or the name I use for my own music.
Not to be rude, but you didn't answer at least two of my questions:
What OS?
Did you have media items selected when you started the script, or did you not have any media items selected? Or does it crash regardless of whether or not you have media items selected upon execution of the script?
I'm going to look into this more.
Has anyone else experienced any odd behavior or crashes from the script, by chance?
I can make it crash consistently but it's not bad. There's also a bug with recoloring. Here are the particulars:
I'm using:
-Item Reader 2.2
-Linux Mint XFCE 19.2
-Reaper for Linux (v5.982 or v5.982+dev0817, I tested with both)
-js_ReaScriptAPI 0.990 from Aug 09
-SWS latest version (2.10.0 #1)
I also got the same behavior with the SWS "next" (unofficial but the most up-to-date as of Aug 09) version of SWS that I built from the source, which has some fixes for the latest DEV builds of Reaper (mouseover stuff).
What causes Item Reader to crash: When I close Reaper (or the project tab), if any item is selected while the Item Reader script is running, I get this error in a window:
Code:
/home/james/.config/REAPER/Scripts/DfkItemReader.lua:1284: bad argument #1 to 'SetMediaItemInfo_Value' (MediaItem expected)
(Yes, I renamed the script file to DfkItemReader.lua since the default file name included special characters once I downloaded it.)
If no items are selected and/or the Item Reader isn't running, this doesn't happen. It also doesn't crash Reaper at any time. This only happens when I'm closing the project (and have items selected, and am running the Item Reader script).
The recolor issue: this script automatically recolors my items (to 000000, black) whenever I select an item (whether they were selected before starting the script, or after starting the script).
One more minor thing: I would also like to mention: I alter the font in the script to not be Times New Roman because it's trickier for my brain to quickly read. I don't mind editing the script (find/replace for Arial works nicely) but if I had a feature request it would be a way of altering the font from the script. Don't bother if it's too much trouble.
Last edited by JamesPeters; 08-17-2019 at 11:08 AM.
Thank you for the detailed post! Really though, very thorough, and much appreciated.
I've been a bit overdone lately but I intend to look into everything you mention in your post. Sorry if this sounds somewhat vague, but I'm going to bed. Just know that I read through your post and I think that everything you mention deserves getting proper attention.
I'll hopefully bring back updates within the next few days!
Not to be rude, but you didn't answer at least two of my questions:
What OS?
Did you have media items selected when you started the script, or did you not have any media items selected? Or does it crash regardless of whether or not you have media items selected upon execution of the script?
I'm going to look into this more.
Has anyone else experienced any odd behavior or crashes from the script, by chance?
I use windows 8.1 . I open the reaper without doing anything else, load the script and it crashes immediately.
I use windows 8.1 . I open the reaper without doing anything else, load the script and it crashes immediately.
Thanks!
Let me put together a version for you to test to see if I can narrow down what is causing the error. If I had to guess, it might be an issue with the frequency of gfx updating in the script, or possibly something to do with defer loops.
As mentioned in my previous post, please give me a few days (at least) because I've been very busy lately. The paint on my walls don't chip by itself.
Side-note@JamesPeters:
Do you think it would be better to include a hotkey that cycles through font styles, or a click-button with a pull-up menu?
I use windows 8.1 . I open the reaper without doing anything else, load the script and it crashes immediately.
Here's a debug version that should let me know which general area of the script is causing your crash. Anywhere from 1-6 debug messages should show before the script crashes (I assume) which will help me to figure out what function is giving your computer issues.
If you don't feel like running it and crashing your REAPER, I completely understand. Either way, it's your choice.
@JamesPeters:
I may have fixed the issue with the script throwing an error message upon closure. I've updated the file in the original post..