There must be something on/with your Mac that is not on/with mine. The script is working as supposed here, and there’s nothing visibly wrong with it.
Yes, that is the expected result.
Last question: Is JavaScript enabled in your DT preferences (under the “Web” tab)? If not, please do so.
The most reliable way to execute JavaScript in AppleScript without depending on preferences, windows or apps is like this:
on encodeURIComponent(uri as text)
run script "encodeURIComponent(" & (the quoted form of uri) & ");" in "JavaScript"
end encodeURIComponent
Executing JavaScript in a window is usually only useful if the window shows a web page, e.g. to apply a bookmarklet.
Well, I didn’t write that script originally, and it does indeed open a HTML document.
Problem solved - I did not have javascript enabled DT - working as expected now. Sorry to have taken all your time and thank you so very much.
1 Like
You’re welcome. That one was an interesting challenge
1 Like