By alex alcanjim @alex_alcanjim
Hi all!
I'm just looking for a script that allow me to remove every marker which containing "Location" on their name.
Any idea?
Thanks in advance for helping!
- samuel henriques @samuel_henriques
Hello @alex_alcanjim,
Try this and let me know how it goes.
function clearMemoryLocations(name) { const isMemLocWinOpened = sf.ui.proTools.getMenuItem('Window', 'Memory Locations').isMenuChecked // // Open mem loc win sf.ui.proTools.memoryLocationsShowWindow() // Get Memory Locations including... const memoryLocations = sf.proTools.memoryLocationsFetch().collection['List'].filter(m => m.name.includes(name)) // Clear found memoryLocations.forEach(memLoc => { sf.ui.proTools.memoryLocationsGoto({ memoryLocationNumber: memLoc.number }) sf.ui.proTools.memoryLocationsWindow.popupButtons.first.popupMenuSelect({ menuPath: ['Clear*'], useWildcards: true }); }); alert(`Cleared All Memory Locations Names Including: \n\n - ${name} -`) // Set initial state of Mem Loc Win if (!isMemLocWinOpened) { sf.ui.proTools.menuClick({ menuPath: ['Window', 'Memory Locations'], targetValue: "Disable" }) }; }; clearMemoryLocations('Location')
samuel henriques @samuel_henriques
Just updated a much simpler version.
- Aalex alcanjim @alex_alcanjim
Hi @samuel_henriques !
Thanks so much! It works perfect!
- In reply tosamuel_henriques⬆:OOwen Granich-Young @Owen_Granich_Young
Here's a verison that allows you to search your memory locations instead of a fixed text. Prompt tech also written by @samuel_henriques
function clearMemoryLocations(name) { // Get Memory Locations including... const memoryLocations = sf.proTools.memoryLocationsFetch().collection['List'].filter(m => m.name.includes(name)) // Clear found memoryLocations.forEach(memLoc => { sf.ui.proTools.memoryLocationsGoto({ memoryLocationNumber: memLoc.number }) sf.ui.proTools.memoryLocationsWindow.popupButtons.first.popupMenuSelect({ menuPath: ['Clear*'], useWildcards: true }); }); }; function prompt(item) { let prompt = sf.interaction.popupSearch({ items: item.map(x => ({ name: x["Name"] })) }).item.name return prompt }; function main() { const isMemLocWinOpened = sf.ui.proTools.getMenuItem('Window', 'Memory Locations').isMenuChecked // // Open mem loc win sf.ui.proTools.memoryLocationsShowWindow() let memoryLocations = sf.proTools.memoryLocationsFetch().collection['List'] let promptValue = prompt(memoryLocations) clearMemoryLocations(promptValue) // Set initial state of Mem Loc Win if (!isMemLocWinOpened) { sf.ui.proTools.menuClick({ menuPath: ['Window', 'Memory Locations'], targetValue: "Disable" }) }; } main()