"open location" buggy in Sierra 10.12.5

I have a little script in my scripts folder that runs in Yosemite:

try
tell application “Screen Sharing” to quit
open location “vnc://pge:xpge@192.168.0.20”
on error errorText
display dialog errorText
end try

Now, in Sierra, it doesn’t work. Instead, I get the message: ‘“vnc://pge:xpge@192.168.0.20” doesn’t understand the “«event GURLGURL»” message.’

But when I run it within Script Editor, it succeeds and opens a window on on the target.

WTF?

Anyway, I had the bright idea to tell Script Editor to open the url. This now works:

try
tell application “Screen Sharing” to quit
tell application “Script Editor”
open location “vnc://pge:xpge@192.168.0.20”
end tell
on error errorText
display dialog errorText
end try

This must be a bug. Anyone else seen this?

This bug was reported soon after the delivery of 10.12.5

It was not striking in the beta versions but was introduced in the distributed version.

It’s corrected in the 10.12.6 beta so we just have to wait a bit.

When I reported it here, I encapsulated the main instruction in a tell application “Safari” . end tell block.
Honestly I never thought that telling to TextEdit may work the same.

Yvan KOENIG running Sierra 10.12.5 in French (VALLAURIS, France) mardi 13 juin 2017 21:00:51

Thanks for the update, Yvan, that it is fixed in 10.12.6 beta.
It has broken some production Workflow Actions I developed that are distributed with a commercial software package.

It"s why I wrote in my message :rolleyes:

Yvan KOENIG running Sierra 10.12.5 in French (VALLAURIS, France) mardi 13 juin 2017 22:08:18