こんにちは。
今週は、オフィス4連チャン。
お天気いいです。
それにしても、高市さん、衆院解散決断。
勝って、政権基盤強化狙ってます。
人気だけど、若い人が選挙行くとは限らない。
結果が楽しみです。
さて、Salesforce 開発者コンソール。
地味だけど使ってます。
クエリ結果
select fields(all) from sample__c limit 50

この結果をコピーしたいときあります。
というか、このままでは見れません😭
ググって方法を調べたけど、有効な記事がヒットしません。
そんな時は、Copilotさん。
Copilot で壁打ちしてやっと完成。
Javascriptブックマークレット 公開。
「Salesforce 開発者コンソールのクエリ結果をコピーする」
=============
Javascript:(function(){const norm=s=>(s??'').toString().replace(/\r?\n/g,' ').trim();function copyText(t){function legacy(x){try{var ta=document.createElement('textarea');ta.style.position='fixed';ta.style.top='10px';ta.style.left='10px';ta.style.width='1px';ta.style.height='1px';document.body.appendChild(ta);ta.value=x;ta.focus();ta.select();var ok=document.execCommand('copy');document.body.removeChild(ta);return ok;}catch(e){return false;}}try{if(navigator.clipboard&&navigator.clipboard.writeText){return navigator.clipboard.writeText(t).then(function(){return true;}).catch(function(){return legacy(t);});}}catch(e){}return Promise.resolve(legacy(t));}function pickFromDoc(doc){if(!doc)return null;let headers=;const seen=new Set();const hdrRow=doc.querySelector('.x-grid3-hd-row');if(hdrRow){hdrRow.querySelectorAll('.x-grid3-hd').forEach(function(h){const inner=h.querySelector('.x-grid3-hd-inner')||h;const txt=norm(inner.textContent);if(txt&&!seen.has(txt)){headers.push(txt);seen.add(txt);}});}if(headers.length===0){const hdrCt=doc.querySelector('.x-grid-header-ct');if(hdrCt){hdrCt.querySelectorAll('.x-column-header').forEach(function(h){const inner=h.querySelector('.x-column-header-inner')||h;const txt=norm(inner.textContent);if(txt&&!seen.has(txt)){headers.push(txt);seen.add(txt);}});}}let rows=;const rowTables=doc.querySelectorAll('.x-grid3-row-table');if(rowTables&&rowTables.length){rows=.map.call(rowTables,function(rt){return .map.call(rt.querySelectorAll('td'),function(td){const el=td.querySelector('.x-grid3-cell-inner')||td;return norm(el.textContent);});});}if(rows.length===0){const rowEls=doc.querySelectorAll('.x-grid-row');if(rowEls&&rowEls.length){rows=.map.call(rowEls,function(r){let cells=.slice.call(r.querySelectorAll('.x-grid-cell'));if(!cells.length)cells=.slice.call(r.querySelectorAll('td'));if(!cells.length)cells=.slice.call(r.children);return cells.map(function(td){const el=td.querySelector('.x-grid-cell-inner, .x-grid3-cell-inner')||td;return norm(el.textContent);});});}}if(!(headers.length||rows.length))return null;let useIdx=;if(headers.length){useIdx=headers.map(function(_,i){return i;});rows=rows.map(function(r){return r.slice(0,headers.length);});}else{const maxLen=rows.reduce(function(m,r){return Math.max(m,r.length);},0);useIdx=Array.from({length:maxLen},function(_,i){return i;});}const esc=v=>String(v??'').replace(/\t/g,' ').replace(/\r?\n/g,' ');const lines=;if(headers.length)lines.push(useIdx.map(i=>esc(headers[i])).join('\t'));rows.forEach(function(r){lines.push(useIdx.map(i=>esc(r[i]??'')).join('\t'));});return {tsv:lines.join('\n')};}function* allDocs(win){yield win.document;for(var i=0;i<win.frames.length;i++){try{yield* allDocs(win.frames[i]);}catch(e){}}}try{var result=null;var it=allDocs(window);for(const doc of it){try{var r=pickFromDoc(doc);if(r&&r.tsv&&r.tsv.trim()){result=r;break;}}catch(e){}}if(!result){try{alert('Query Results のグリッドを見つけられませんでした。SOQL 実行後の画面で実行してください。');}catch(e){}return;}copyText(result.tsv).then(function(ok){if(ok){try{alert('Query Results をヘッダ付きでコピーしました。');}catch(e){}}else{try{prompt('コピーできない場合は Ctrl+A → Ctrl+C でコピーしてください(TSV)',result.tsv);}catch(e){console.log(result.tsv);}}});}catch(e){try{alert('エラー: '+e);}catch(_){}}})();
=============
このURLをブラウザでお気に入り登録します。

開発者コンソールは、ポップアップではなく
ブラウザのタブでオープンしないとダメ。

Copilot、素晴らしい。