This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Archive all read emails that have been read and | |
| * it has been 7 days. | |
| * | |
| */ | |
| function archiveInbox() { | |
| // search for threads based on following parameters | |
| var threads = GmailApp.search('label:inbox is:read older_than:7d'); | |
| for(var i=0; i<threads.length; i++) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| has:nouserlabels !in:Inbox -label:sent -label:drafts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Build Act 1/Act 2 regions from named markers, then delete ONLY the used markers | |
| -- Return: pos, id (id = markrgnindexnumber needed for safe deletion) | |
| local function findMarker(name) | |
| local target = (name or ""):gsub("%s+", " "):match("^%s*(.-)%s*$"):upper() | |
| local _, num_markers, num_regions = reaper.CountProjectMarkers(0) | |
| local total = num_markers + num_regions | |
| for i = 0, total - 1 do | |
| local ret, isrgn, pos, rgnend, nm, id = reaper.EnumProjectMarkers3(0, i) | |
| if ret == 0 then break end | |
| if not isrgn and nm then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Check_Any_Track_Armed.lua | |
| -- Writes armed track count and timestamp for QLab to read. Silent inside REAPER. | |
| local resource = reaper.GetResourcePath() | |
| local status_path = resource .. "/reaper-qlab-status.txt" | |
| -- Count armed tracks | |
| local armed = 0 | |
| for i = 0, reaper.CountTracks(0) - 1 do | |
| local tr = reaper.GetTrack(0, i) |