Clipboard->Javascript->Clipboard

Hi, I need to take the contents of the clip board, remove all characters after (and including) the "?" symbol, then write it back into the clipboard. How can I do that?

In Javascript the code would be searchText.replace(/?./g, "$1")*. I can't get this to work on the clipboard. Also, it doesn't have to be Javascript, whatever works. ;-)))

This is for shortening Hook links, such as from hook://file/0B3SgD8hB?p=aHRtYWMvRGVza3RvcA==&n=soundhack-0.0.9-max-mac64 (which is awfully long) into hook://file/0B3SgD8hB

Any leads are greatly appreciated!

Hans

Easy:

image

RegEx:
\?.+

1 Like

Oy, that was easy... thanks!