How to use Search Markers with Selection Memory Locations?
I'm trying to use "Search Markers" feature but it seems that only works with common markers. It doesn't work if I use "Selection Memory Locations" as I do.
Any idea about how to make it works? Thanks!
Linked from:
- Christian Scheuer @chrscheuer2020-09-03 18:40:49.031Z
Hi Alex,
Thanks for asking here.
As you've noted, we filter out Selection Memory Locations from the Search Markers feature.
You can't get 100% the same behavior with this script, but close enough, this would allow you to search the current memory locations in your session, including Selection types:function getMemoryLocations() { sf.ui.proTools.appActivate(); sf.ui.proTools.mainWindow.elementRaise(); var i = 0; while (i++ < 5) { if (!sf.ui.proTools.memoryLocationsWindow.invalidate().exists) { sf.ui.proTools.getMenuItem('Window', 'Memory Locations').elementClick({}, 'Could not click to open Memory Locations window'); sf.ui.proTools.memoryLocationsWindow.elementWaitFor(); } var table = sf.ui.proTools.memoryLocationsWindow.invalidate().tables.first; if (!table.exists) { sf.ui.proTools.memoryLocationsWindow.windowClose(); } } if (!table.exists) throw 'Could not find memory locations table'; var seed = (new Date).valueOf(); var items = []; table.children.forEach(function (item, i) { var num = item.children[0].children[0].title.value; var text = item.children[1].children[0].title.value; if (num === null || text === null) return; items.push({ name: num, num, text, }); }); return items; } var num = sf.interaction.popupSearch({ items: getMemoryLocations(), columns: [ { name: 'Number', key: 'name', width: 20, }, { name: 'Text', key: 'text', width: 80, }, ], }).item.num; sf.ui.proTools.appActivate(); sf.ui.proTools.mainWindow.elementRaise(); sf.ui.proTools.memoryLocationsGoto({ memoryLocationNumber: Number(num) });
- AIn reply toalex_alcanjim⬆:alex alcanjim @alex_alcanjim
Wow!! Sounds awesome!
I’ll try it ASAP!
Thanks so much for your help!
- AIn reply toalex_alcanjim⬆:alex alcanjim @alex_alcanjim
Hi Christian!
I've tried this new code and something doesn't works correctly.
First of all, it only works if Memory Locations Window is closed before running the command. Maybe It would be usefull to make "force close Memory Location Window" before the script.
After that, once the "Search dialog" appears, when you type any text finding a memory location, the Search Window doesn't shows any result.
Could you please check it?
Thanks so much in advance for your help!
Christian Scheuer @chrscheuer2020-09-06 12:49:22.647Z
Hi Alex,
Can you show us a screenshot of the text you're typing when you search and of the search dialog with the content? It's likely that you're searching for something that the search algorithm doesn't support.
- Aalex alcanjim @alex_alcanjim
Hi Christian,
Just trying to figure out what is happening. Here you can find some screenshots.
Here you can see my Memory Location list and the "Search Box" opened. When I try to search any Memory Location by name, nothing happens. Here comes a screenshot as example.
But, if I try to search by number, It seems like the script is working perfectly. Here comes and example:
It seems like the "Search engine" is only looking on Memory Location number and not on the Memory Location name.
Is there any way to make it works using Memory Location names?
Thanks so much in advance for your help!
Christian Scheuer @chrscheuer2020-09-17 15:04:50.619Z
My apologies - please try this instead:
function getMemoryLocations() { sf.ui.proTools.appActivate(); sf.ui.proTools.mainWindow.elementRaise(); var i = 0; while (i++ < 5) { if (!sf.ui.proTools.memoryLocationsWindow.invalidate().exists) { sf.ui.proTools.getMenuItem('Window', 'Memory Locations').elementClick({}, 'Could not click to open Memory Locations window'); sf.ui.proTools.memoryLocationsWindow.elementWaitFor(); } var table = sf.ui.proTools.memoryLocationsWindow.invalidate().tables.first; if (!table.exists) { sf.ui.proTools.memoryLocationsWindow.windowClose(); } } if (!table.exists) throw 'Could not find memory locations table'; var seed = (new Date).valueOf(); var items = []; table.children.forEach(function (item, i) { var num = item.children[0].children[0].title.value; var text = item.children[1].children[0].title.value; if (num === null || text === null) return; items.push({ name: num + ' ' + text, num, text, }); }); return items; } var num = sf.interaction.popupSearch({ items: getMemoryLocations(), columns: [ { name: 'Number', key: 'num', width: 20, }, { name: 'Text', key: 'text', width: 80, }, ], }).item.num; sf.ui.proTools.appActivate(); sf.ui.proTools.mainWindow.elementRaise(); sf.ui.proTools.memoryLocationsGoto({ memoryLocationNumber: Number(num) });
- TTim Miller @Tim_Miller
Hello Christian!
This script only works for me if the Memory Locations window is closed before running it. I like to keep mine open, so is there a way to run this script where it will look to see if the memory locations window is already open then pull up the search window?
I cut SFX/BGs/Foley for feature films and if I can get this script to work, it would be a HUGE time saver for me!
Tim
- TTim Miller @Tim_Miller
or just have it close the memory locations window after the search is complete? Otherwise I just get a glitch where the search box will quickly open/close and disappear if the memory locations window is already open.