How to write to clipboard as an coda pack actions

need some coda pack programming help:

the code im trying to run make work is:

navigator.clipboard.writeText(someParameterString);

placed inside the execute: async function(...){...}

but it doesn’t work or i can’t figure out how to or what am i lacking of… or is it possible in the first place?

document.execCommand(‘copy’) is already a depreciated web api and refrain as a solution suggestion

Unfortunately this isn’t possible at the moment. navigator is an object that’s only available in client-side, browser JavaScript. Packs on the other hand run on Coda’s servers, and don’t have access to this object or the user’s clipboard in general. At the moment the Pack Studio code editor autocomplete is showing some objects that aren’t available, but that should be fixed in a few days.

1 Like