In AppleScript, how to open a URL location that contains a hash (#)?

I have a workflow written in Alfred that when opening a URL location in AppleScript, the URL will be urlencoded() which effectively breaks:

open location "https://example.com/#hello" & selectedText

will open the URL https://example.com/%23hello.

The %23 should really stay #. How can this be achieved?


Solution 1:

This is because Alfred is encoding (UTF8) the URL.

enter image description here

Disable it and it will work.