Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Bulk copy a specific span/div class from all opened mega.co.nz/folder urls (left to right tabs)

129 views
Skip to first unread message

Yu Ho

unread,
Feb 28, 2025, 9:11:09 PMFeb 28
to AutoControl Community Forum
The span class is .not-loading selectable-txt and div class is .fm-right-header div.fm-breadcrumbs-block. Is it possible to bulk copy this specific class from all tabs matching mega.co.nz/folder? If so, please let me know how to.
Message has been deleted

AutoControl support

unread,
Mar 4, 2025, 4:57:05 AMMar 4
to AutoControl Community Forum
You have to use the Run script action to run the following background script:
let results = await ACtl.runInTab( {url: /^https:\/\/mega.co.nz\/folder/}, ()=>{ let elems = document.querySelectorAll('span.not-loading.selectable-txt, div.fm-right-header.fm-breadcrumbs-block') return [...elems].map( elem => elem.innerText ) }) await ACtl.setClipboard( [].concat(...results).join('\n') )
The script gets the text inside the SPAN and DIV elements for every mega.co.nz tab. Then, all those text strings are joined with a newline character in between and finally the resulting text is put in the clipboard.

Yu Ho

unread,
Mar 5, 2025, 4:37:56 AMMar 5
to AutoControl Community Forum
Thanks for the response. It doesn't copy to the clipboard when I press the trigger Middle mouse button or Right click. The expected output is "機動戦士ガンダム 水星の魔女 The Witch From Mercury (オリジナルサウンドトラック)". What am I doing wrong? Here's a folder url: https://mega.nz/folder/rNslnTgC#aaIyysVuomfBLPpGRfpUHA and here are the screenshots:

image.png
image.png
image.png

kaJ1ueLMbY.png




Can you also add a way to fetch the filename from a file link? here's a file url: https://mega.nz/file/yAVw2bxA#sl9uwEI_hTvlMU01GVqCEHBtk-1GwZqkAAAAAAAAAAA and the filename should be "test.txt" based on the file url

G3N6HbyZ9L.png

Yu Ho

unread,
Mar 5, 2025, 4:41:00 AMMar 5
to AutoControl Community Forum
Missing screenshots:

P3JDu4Mi3W.pngZ5Qwk6X2gm.png

AutoControl support

unread,
Mar 6, 2025, 11:48:13 PMMar 6
to AutoControl Community Forum
Here is the corrected script. The domain is mega.nz, not mega.co.nz as you mentioned initially.
This new script copies both file names and folder names.
let results = await ACtl.runInTab( {url: /^https:\/\/mega.nz\/(folder|file)/}, ()=>{ let elems = document.querySelectorAll('.fm-breadcrumbs.folder, .file-details-wrapper .title-block') return [...elems].map( elem => elem.innerText.replace('\n','') ) }) await ACtl.setClipboard( [].concat(...results).join('\n') )
 

Yu Ho

unread,
Mar 8, 2025, 2:13:58 AMMar 8
to AutoControl Community Forum
Works like magic. Thank you so much! I added  #currWinTabs  to runInTab to ensure that the order is preserved and managed to figure out how to adapt it to mediafire. Thank you so much!
Reply all
Reply to author
Forward
0 new messages